In the managed approach, I've noticed that the simulation does not check for fills until OnBarUpdate() is done. Thus, AFAIK, it doesn't matter if in OnBarUpdate() I first call EnterLongLimit(), and only than set the brackets using SetProfitTarget() and SetStopLoss(). Namely, The following are equivalent:
// Sample A is equivalent to...
protected override void OnBarUpdate()
{
EnterLongLimit(Price);
SetStopLoss(CalculationMode.Ticks, SlTicks);
SetProfitTarget(CalculationMode.Ticks, PtTicks);
}
// ...Samle B
protected override void OnBarUpdate()
{
SetStopLoss(CalculationMode.Ticks, SlTicks);
SetProfitTarget(CalculationMode.Ticks, PtTicks);
EnterLongLimit(Price);
}
- Is this also the case in real time? Namely, will the core wait until we leave OnBarUpdate() to actually send the orders?
- How about the Unmanaged approach? Are the orders sent right-away, or only after we leave OnBarUpdate()?
Thanks,
Boaz

Comment