add rank
1. fix ma20
2. fix get_history function for realtime