I am using NT in simulation mode. I have encoutered a peculiar problem with SetTrailStop(). It behaves exactly like SetStopLoss(), i.e. the stop does not trail. Verified this from SuperDOM. But could this relate to the fact that the entry orders are not place within OnBarUpdate()?? Code:
#region Variables
// Parameters
private bool useTrailStop = true;
private int maxLoss = 8;
private int lotsPerTrade = 1;
#endregion
protected override void Initialize()
{
if (UseTrailStop)
{
SetTrailStop(CalculationMode.Ticks, MaxLoss);
}
else
{
SetStopLoss(CalculationMode.Ticks, MaxLoss);
}
}
protected override void OnMarketData(MarketDataEventArgs e)
{
// Code
...
Main();
}
protected override void OnMarketDepth(MarketDepthEventArgs e)
{
// Code
...
Main();
}
private void Main()
{
// Code
...
EnterLong(0, LotsPerTrade, "ENTER_LONG");
}
Comment