if XXX happens then
EnterLong(1,"Long 1");
EnterLong(1,"Long 2");
if XXX happens then
ExitLong(1,"Long Exit 1","Long 1");
ExitLong(1,"Long Exit 2","Long 2");
I have similar code for the short entry and exit. In 'Initialize' section of the script, I have the following:
EntriesPerDirection = 1;
EntryHandling = EntryHandling.UniqueEntries;
SetProfitTarget("Long 1", CalculationMode.Ticks, profittargetticks1);
SetProfitTarget("Long 2", CalculationMode.Ticks, profittargetticks2);
SetProfitTarget("Short 1", CalculationMode.Ticks, profittargetticks1);
SetProfitTarget("Short 2", CalculationMode.Ticks, profittargetticks2);
SetStopLoss(CalculationMode.Ticks, stoplossticks);
The problem is that the strategy is taking a trade on every single bar. Can someone please help to figure out what is wrong here? Very much appreciate your help in advance.
Thanks!
Comment