i have a problem and can't figure out what's wrong. I think i probably overlooked something.
I often have multiple entries and stops for the same price, especially with trailing stops (check the first attached photo for an example).
The main Dataseries from the Chart is a 1Day Series and i added a 1 Tick Dataseries for my entries.
So i do stuff like GetCurrentBid on the Tick Dataseries.
And also for the EnterLong and EnterShort i use the index of the Tick Dataseries.
Heres an example how i do the entries:
if (BarsInProgress == 2) { if (Open[0] > _daylieVa.VAH[1]) { if (_daylieVa.VAH[1] == GetCurrentAsk(2)) { EnterLong(2, 1, ""); Print("EnterLong from VAH --> VAH:" + _daylieVa.VAH[1] + " CurrentAsk:" + GetCurrentAsk(2)); } } else { if (_daylieVa.VAL[1] == GetCurrentAsk(2)) { EnterLong(2, 1, ""); Print("EnterLong from VAL --> VAL:" + _daylieVa.VAL[1] + " CurrentAsk:" + GetCurrentAsk(2)); } } }
else if (State == State.Configure) { AddDataSeries(Data.BarsPeriodType.Second, 1); AddDataSeries(Data.BarsPeriodType.Tick, 1); _daylieVa = DaylieVA(false, new TimeSpan(0), new TimeSpan(0), 70); AddChartIndicator(_daylieVa); if (TrailingStop > 0) SetTrailStop("", CalculationMode.Ticks, TrailingStop, false); else if (StopLoss > 0) SetStopLoss("", CalculationMode.Ticks, StopLoss, false); if (TakeProfit > 0) SetProfitTarget("", CalculationMode.Ticks, TakeProfit); }
Best regards
Simon
Comment