I want to improve a present code that I have. it currently only has a hard stop. The strategy has targets built into it, but those targets are almost never reached, so therefore so many of my trades stop out at the eight tick stop.
Instead of messing around with the logic of the targets on the existing code (which I don't rightly understand), I'd like to simply add a trailing stop that kicks in when a three tick profit has been reached. If the three tick profit is never reached, the trade stays open until it hits the hard stop. But if the three tick profit is reached, the trailing stop kicks in, the hard stop is set aside, and trades rides out till the trailing stop is it. Basically an OCO type exit.
I know this can be done with an ATM in superdom, in fact I have an ATM that does this well. But I am no where near figuring out how to have ninjascript reference ATM strategies. I'm thinking it might be easier just to code it.
Here's what I have so far:
{
SetStopLoss("", CalculationMode.Ticks, 8, false);
SetTrailStop("", CalculationMode.Ticks, 3, false);
CalculateOnBarClose = true;
}

Comment