If i remove
ExitLongStopMarket(0, true, 1, fvgIndicator.LowerPriceL[0], "SLL", "Long");
ExitLongLimit(0, true, 1, Position.AveragePrice + (TickSize * 35), "PTL", "Long");
and just use set methods strategy opens fine
SetProfitTarget(CalculationMode.Ticks, 25);
SetStopLoss(CalculationMode.Ticks, 25);
I dont want to use set methods... No errors
protected override void OnBarUpdate()
{
if(CurrentBar < 10)
return;
// if (CurrentBars[0] < 10 || CurrentBars[1] < 10 )
// return;
if(Low[0] < fvgIndicator.UpperPriceL[0] && fvgIndicator.IsLongFVG[0] == -1 )
{
EnterLong(1, "Long");
Print("Entering Long" + Time[0]);
if (Position.MarketPosition == MarketPosition.Long ) {
if(Position.AveragePrice - (fvgIndicator.LowerPriceL[0]) <= GetCurrentBid()){
ExitLongStopMarket(0, true, 1, fvgIndicator.LowerPriceL[0], "SLL", "Long");
ExitLongLimit(0, true, 1, Position.AveragePrice + (TickSize * 35), "PTL", "Long");
}
}
}
if(High[0] > fvgIndicator.LowerPriceS[0] && fvgIndicator.IsShortFVG[0] == 1 )
{
EnterShort(1, "Short");
Print("Entering Short" + Time[0]);
}
}

Comment