Profile Picture

Shifted CurrentDate

Posted By johan 3 Years Ago
Message
Posted Thursday July 24 2014
I am developing position sizing code for a CFD. All of SystemData current date data is after the bar has closed, e.g. if I open a position MarketOnOpen, the CurrentValueLong will only refelct the next day. this makes interest and position sizing calculations difficult. Is there a way to set the CurrentDate in initialization to the previous bar, as this will be the easiest to solve the problem - it, however, seems to be a readonly.
Posted Thursday July 24 2014
If you need the LongValue from the previous bar, try SystemData.SystemStatistics.BarStats[Bars.LookBack(1).BarStartTime].LongValue;

The “1” in the LookBack method indicates the number of bars prior.

Duane

Edited: Thursday July 24 2014 by alpha23


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems