Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- H = closing_price + ATR
- L = closing_price - ATR
- If H #new# > H.shift(1) #previous#
- H_TS = H.shift(1)
- else
- H_TS = H
- If L #new# > L.shift(1) #previous#
- L_TS = L.shift(1)
- else
- L_TS = L
- If closing_price > H_TS
- ATR_TS = L_TS
- If closing_price < L_TS
- ATR_TS = H_TS
- df = pd.read_csv('EURUSD_pp.csv',index_col='date')
- df['h'] = df['bidclose'] + ATR(df['bidclose'],10)*2
- df['h_shift']= df['h'].shift(1)
- df['ATR_H_line'] = np.NaN
- df['ATR_H_line']= np.where((df['h'] > df['hh']),df['hhh'].shift(1),df['h'])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement