1- Are Entries and Exits executed only on Closing of Bars?
2- During a Live Test, I'll like to have the following script to work:
protectedoverridevoid OnBarUpdate()
{
//Only run on real-time data
if (Historical)
return;
if (BarsInProgress == 0)
{
if (CrossAbove(SMA(1), Bollinger(BarsArray[1],2, 14).Upper, 0))
{
EnterLong(DefaultQuantity, "EnterLong");
}
What I'm looking for is to have the SMA for a 1min chart CrossAbove the Bollinger bands from another chart time such as the 1 day chart to enter a long position.
What I've noticed during my tests is that the Position won't get entered untill the Bar for the Daily chart is closed or entered randomly. I already had set in the Initialize section the
Add(PeriodType.Day, 1);
CalculateOnBarClose = false;
but still won't execute at the tick or at least at the closing of the 1 minute bar chart. What happens is that is waiting for the 1 day Bar to close to then enter long or the prders are entered randomly. Any suggestions?
Comment