I'm still trying to work out the best way to implement my automated strategy.
Yes, I have a strategy that enters ATMs automatically (based on SampleAtmStrategy), but one of the drawbacks I hadn't considered, is that there's no way of adjusting variables in an ATM as one can in a strategy. This means I'll have to produce a large number of ATMs for every possible time period or Renko length. This can be confusing and lead to mistakes.
Moreover, I won't be using trailing stops.
I'm considering reverting to a traditional strategy using SetTrailStop, SetProfitTarget, etc.
I wish to incorporate into this strategy, though, an essential element of ATMs: the break even aspect. I've worked out some code that I'm hoping will do the trick:
int a = 0;
int i = 1;
while (i <= BarsSinceEntry())
{
if( Position.GetProfitLoss(Close[i], PerformanceUnit.Points) < ProfitTrigger1 )
{
i++;
continue;
}
else
a = 1;
break;
}
if (
Position.MarketPosition == MarketPosition.Long
&& Position.GetProfitLoss(Close[0], PerformanceUnit.Points) <= BreakEvenPlus1
&& a == 1
)
{
ExitLong("Long1"); // LongQuantity1,
}
Two questions:
1) Does the above code look like it might successfully operate as a break even?
2) Although I think I'm asking for the impossible, is there any wonderfully erudite way of making different parts of a strategy operate with CoBC = True and others CoBC = False? Or at least fooling the strategy into making part of it act differently?
Any advice as regards these points will be greatly appreciated.

Comment