Code for broken entries:
private void ExecuteLongEntry(BarType previousBarType, BarType currentBarType) { if (longLastEntryBar != CurrentBar) { // Enter a position with a size of 4 SetProfitTarget("my1stentry", CalculationMode.Ticks, 80); SetProfitTarget("my2ndentry", CalculationMode.Ticks, 100); SetProfitTarget("my3rdentry", CalculationMode.Ticks, 120); SetProfitTarget("my4thentry", CalculationMode.Ticks, 140); EnterLong( 1, "my1stentry"); EnterLong( 1, "my2ndentry"); EnterLong( 1, "my3rdentry"); EnterLong( 1, "my4thentry"); longEntryCount++; longLastEntryBar = CurrentBar; longEntryBarHigh = High[1]; longEntryBarLow = Low[1]; formingBarLow = High[0]; } }
Code that works with single entry:
private void ExecuteShortEntry(BarType previousBarType, BarType currentBarType) { if (shortLastEntryBar != CurrentBar) { EnterShort(1, Convert.ToInt32(4), "Short"); SetProfitTarget(CalculationMode.Ticks, 75); shortEntryCount++; shortLastEntryBar = CurrentBar; shortEntryBarHigh = High[1]; shortEntryBarLow = Low[1]; formingBarHigh = High[0]; } }
I'm using tick replay, and the only difference is the number of orders
Comment