Q1.I use SetStopLoss("trade1", CalculationMode.Price, Position.AvgPrice + (T1*TickSize) , false);
Should I use "true" instead of false for market replay and hist. backtesting ? I run it w.
CalculateOnBarClose = false;
EntryHandling = EntryHandling.UniqueEntries;
Here is the code for Long:
if (Position.MarketPosition == MarketPosition.Long)
{
if(Close[0] <= (Support().S1[0] - 3*TickSize) && (BarsSinceEntry() >= 2 ) )
{
SetStopLoss("trade1", CalculationMode.Price, GetCurrentBid(), false );
SetStopLoss("trade2", CalculationMode.Price, GetCurrentBid(), false );
SetStopLoss("trade3", CalculationMode.Price, GetCurrentBid(), false );
}
if (High[0] > Position.AvgPrice + (T1*TickSize) )
SetStopLoss("trade1", CalculationMode.Price, Position.AvgPrice + TickSize , false);
if (High[0] > Position.AvgPrice + (T1*TickSize) )
SetStopLoss("trade2", CalculationMode.Price, Position.AvgPrice + TickSize , false);
if (High[0] > Position.AvgPrice + (T1*TickSize) )
SetStopLoss("trade3", CalculationMode.Price, Position.AvgPrice + TickSize , false);
}
Q2: The strategy uses the same names for going short.Is it ok ? It is either long or short, not both direction at the same time.
Q3: After the targets for trade 1 and 2 are hit, it doesn't go to breakeven (but it should), but keeps the original stoploss which is entered when initiating all 3 trades at the same time.
Q4: I use SetStopLoss more than once here for the same trade. Is it a problem ?
Q5: Maybe there are well explained strategy templates for using stoplosses and trailing stops without any bugs which actually work. If not, it would be really great, if someone made some. Detailed video tutorials with coding examples for stoplosses,trailing stops and targets would be greatly appeciated by many others, not just me. Coding and using stoplosses, trailing stops and profit targets should be intuitive and easy to use.
Thank you for your answers. monnn

Comment