Strategy help: Trying to have entry, set stop loss, and set target on the next bar
I have some moderate Easy Language indicator programming ability. Most of the strategy entry/exit/position stuff is new to me. I hope you can help me. FYI, I have and use both MultiCharts and TS. I am trying to phase out of TS into MC, so that's where I am trying to execute this.
I am trying to code a strategy that sets a limit entry (on some Entry Condition) AND a fixed stop loss AND a fixed target on the next bar. I am trying to code a 'set and forget' kind of thing for EOD daily trading. I want all 3 (limit entry, stop, target) to all fire on the SAME BAR and to execute at specific prices. And I want the stop and target to persist as long as my entry is active (marketposition = 1 or -1).
The easy way to visualize this is like what happens during strategy trading on Ninja: as soon as your order is hit a stop and target are sent immediately. And they stick around until one of them is hit.
In general, I am using something like a Keltner Channel and, for a LONG trade, my setup condition resembles: if the channel is headed up and the bar closes above the midline , I want to set a limit order at the midline (below price), and a target at the upper channel, and a stoploss at the lower channel, to trigger at the NEXT bar, all three.
The idea is not revolutionary, a quick pullback in an uptrend triggers a limit order and sets a stop below and a target above. Reverse for shorts. BTW, there is a PDF all over the WWW describing this method as a Linda Bradford Raschke setup in an issue of Chartpoint. You can find it by googling "Kevin Ho Scalp Trading Methods." It is Pattern 5: The 5-Minute Standard Deviation Scalp in the PDF. I am trying to turn that into a end of day backtestable strategy.
I also tried using code which enters next bar and is followed by stop and target next bar after that (next after next, if you get me ):
This seemed to sort of work, but didn't in two ways: 1. The stop and target execution were at bar close instead of at specific prices, and 2. The entry bar did not have the stop and target attached until the following bar, meaning that trades entered and exited on the same bar were not shown. In a fast 1:1 RR 1xATR method like this, it happens often enough to matter. A single bar dipping down followed by a one ATR upthrust in an uptrend happens all the time
I don't know enough about Bar Magnifier to know if it is useful here. I don't think I can use intrabarordergeneration because I am using daily bars and would like to test this against years of data. I don't have years of minute data available to match it.
I am sure others beside myself would benefit from this. Daytrading wears me out. I would love to test and have faith in a good ole' EOD method that I set at 5 pm and walk away from. But have faith in it from solid testing and statistics. I hope to recreate reality in backtesting as faithfully as possible, including same day entries and exits.
I don't post here much but I read a lot and learn a lot. Thanks to all!