Why are the tick offsets for buy and sell orders in the code below not computed on the chart for historic data?
Also,
Even though calculate on bar close is set to false, why is NT still calculating buy and sell orders on first tick of new bar? ( both historic and realtime data)
Thanks,
RJay
----------------------------------------------------------------------
publicclass Atrend : Strategy
{
#region Variables
// Wizard generated variables
private int plusBarRange = 4; // Default setting for PlusBarRange
private int minusBarRange = -4; // Default setting for MinusBarRange
// User defined variables (add any user defined variables below)
#endregion
///<summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
///</summary>
protectedoverridevoid Initialize()
{
CalculateOnBarClose = false;
}
///<summary>
/// Called on each bar update event (incoming tick)
///</summary>
protectedoverridevoid OnBarUpdate()
{
// Condition set 1
if (GetCurrentBid() > Close[1] + PlusBarRange * TickSize)
{
EnterLong(DefaultQuantity, "");
}
// Condition set 2
if (GetCurrentAsk() < Close[1] + MinusBarRange * TickSize)
{
EnterShort(DefaultQuantity, "");
}
}

Comment