The code below is entering a position and setting the BOOL to true. My question: how do you tell the strategy to keep the BOOL value true until a target is hit, then set the BOOL value to false after the target is reached?
--------------------------------------
if (criteria to enter trade)
{
EntryCandleHigh = High[0];
EntryCandleLow = Low[0];
LongTarget = (EntryCandleHigh - (EntryCandleLow-0.25)) * RiskReward;
EnterLongLimit(Convert.ToInt32(DefaultQuantity), EntryCandleHigh, @"EnterLong");
SetStopLoss(@"EnterLong", CalculationMode.Price, EntryCandleLow-0.25, false);
SetProfitTarget(@"EnterLong", CalculationMode.Price, EntryCandleHigh + LongTarget);
TradeInProgress = true;
}
Comment