我的头在熊猫圈里绕不动。以这个代码为例
import pandas as pd
eurusd = pd.read_csv('EURUSD.csv',index_col='Date',parse_dates=True,usecols=['Date','High','Low','Open','Close'])
gbpusd = pd.read_csv('GBPUSD.csv',index_col='Date',parse_dates=True,usecols=['Date','High','Low','Open','Close'])
audusd = pd.read_csv('AUDUSD.csv',index_col='Date',parse_dates=True,usecols=['Date','High','Low','Open','Close'])
eurusd['MovingAvg'] = pd.rolling_mean(eurusd.Close,100)
gbpusd['MovingAvg'] = pd.rolling_mean(gbpusd.Close,100)
audusd['MovingAvg'] = pd.rolling_mean(audusd.Close,100)
我该如何实现
if the eurusd.Close is less than the eurusd.MovingAvg
AND if gbpusd.Close is less than the gbpusd.MovingAvg
AND if audusd.Close is GREATER than the audusd.MovingAvg
then set some condition to TRUE
使用股票和雅虎金融来说明这个概念:
相关问题 更多 >
编程相关推荐