Everytime I begin a code for a new session, I need to do a one time calculation:
The difference between the Last Session's Close minus the very first Close[0] of the new session. Searching in the help guide, I've known this interesting method: Bars.GetDayBar(1).Close which, supposedly it will have that last session Close that I want to find. So I did a little snippet to be run under OnStartUp() method, this is as follows:
if ( (Close[0]-Bars.GetDayBar(1).Close) >= 0 ) { // Do something } else { // Do otherwise }
In Forex a new session begins at 17:15 hours, so the method Bars.GetDayBar(1).Close, would really give me the the very Last Close at 17:00 of the PAST last session?
If not, please would you indicate how to address it correctly?
Thanks
Comment