Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. H = closing_price + ATR
  2. L = closing_price - ATR
  3.  
  4. If H #new# > H.shift(1) #previous#
  5. H_TS = H.shift(1)
  6. else
  7. H_TS = H
  8.  
  9. If L #new# > L.shift(1) #previous#
  10. L_TS = L.shift(1)
  11. else
  12. L_TS = L
  13.  
  14. If closing_price > H_TS
  15. ATR_TS = L_TS
  16.  
  17. If closing_price < L_TS
  18. ATR_TS = H_TS
  19.  
  20. df = pd.read_csv('EURUSD_pp.csv',index_col='date')
  21. df['h'] = df['bidclose'] + ATR(df['bidclose'],10)*2
  22. df['h_shift']= df['h'].shift(1)
  23. df['ATR_H_line'] = np.NaN
  24. 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