I am programming a strategy that trades more than 1 instrument at the time, I was wondering if the following code makes sense or has programming issues:
if (Positions[1].MarketPosition == MarketPosition.Long && BarsSinceEntry(BarsArray[1]) >= nBarsInTrade && Position.GetProfitLoss(BarsArray[1],Closes[1][0], PerformanceUnit.Points) >= 0) SetStopLoss(...);
1. if it makes sense to use:
BarsSinceEntry(BarsArray[1])
to calculate the bars since entry on my secondary instrument;
2.1. if it makes sense to use:
Position.GetProfitLoss(BarsArray[1],Closes[1][0], PerformanceUnit.Points) >= 0)
to calculate the profit on the secondary instrument;
Thanks for your advise

Comment