zeller4
07-29-2010, 10:00 AM
Hello,
I'm learning about multiple time frames in strategies.
Add(PeriodType.Minute, 1);
OnBarUpdate
//primary set on 3 min chart
if (BarsInProgress == 1)//set on 1 min chart
{
orderLimitPriceL = Instrument.MasterInstrument.Round2TickSize(Median[1]+2*TickSize);
}
OnBarUpdate, set bool.
if (Closes[0][0] > Opens[0][0]
)
{
Buy = true;
BackColor = Color.White;
}
OnBarUpdate, I want to draw some rays
if (BarsInProgress == 1)
{
if (Buy){ DrawRay("MyRayL", 1, orderLimitPriceL, 0, orderLimitPriceL, Color.Blue,DashStyle.DashDotDot,3);
}
My secondary limitprices don't line up with my drawrays on the primary.
Three questions.
Is the if (BarsInProgress == 1) needed to update the orderLimitPrices?
If I have if(BarsInProgress == 1 && Closes[0][0] > Opens[0][0])
is that going to update every time the secondary bar closes?
If I have if(BarsInProgress == 0 && Closes[0][0] > Opens[0][0]), is there a reduncancy in BarsInProgress with the [0]index of the "Closes"?
Please help with any suggestions.
Best Regards,
Kirk
I'm learning about multiple time frames in strategies.
Add(PeriodType.Minute, 1);
OnBarUpdate
//primary set on 3 min chart
if (BarsInProgress == 1)//set on 1 min chart
{
orderLimitPriceL = Instrument.MasterInstrument.Round2TickSize(Median[1]+2*TickSize);
}
OnBarUpdate, set bool.
if (Closes[0][0] > Opens[0][0]
)
{
Buy = true;
BackColor = Color.White;
}
OnBarUpdate, I want to draw some rays
if (BarsInProgress == 1)
{
if (Buy){ DrawRay("MyRayL", 1, orderLimitPriceL, 0, orderLimitPriceL, Color.Blue,DashStyle.DashDotDot,3);
}
My secondary limitprices don't line up with my drawrays on the primary.
Three questions.
Is the if (BarsInProgress == 1) needed to update the orderLimitPrices?
If I have if(BarsInProgress == 1 && Closes[0][0] > Opens[0][0])
is that going to update every time the secondary bar closes?
If I have if(BarsInProgress == 0 && Closes[0][0] > Opens[0][0]), is there a reduncancy in BarsInProgress with the [0]index of the "Closes"?
Please help with any suggestions.
Best Regards,
Kirk