Just for example, I am assigning a stop and profit target upon entering a trade within the onBarUpdate() method like so:
EnterLong(Convert.ToInt32(lotSize), "BuySignal"); SetStopLoss(@"BuySignal", CalculationMode.Pips, myStop, false); SetProfitTarget(@"BuySignal", CalculationMode.Pips, myTgt);
However, if allowing multiple entries, there is no way to know which signal needs to be adjusted.
So... I was thinking of doing this, I would assign each trade its own unique signal name... storing this name into a list, along with the entry price, and a flag if the trade is still active. And on each bar, update this list to see if the trade is open, or if a price has been achieved to update the stop(if still active).
The above will work, but it is a bit of work.
So I am wondering if there is a better way of doing this, or if there is a trade collection that will have these metrics for active trades, like something using GetTrade(), or something else, so I am not reinventing the wheel?
Thanks!
Comment