Simple strategy help: Channel Breakout + ATR Stop
Author: BarisKaya
Creation Date: 2/6/2014 3:17 PM
profile picture

BarisKaya

#1
I am trying to build a simple strategy but not sure if this can be done via the rules only without writing code.

Strategy should initiate a buy when price closes above highest 20day close, and set a stop 3*ATR away from the highest high since the buy is initiated. Vice versa sell short when price closes below lowest 20d close, and set a stop 3*ATR away from the lowest low since initiated short position. that easy, but i wonder if this can be done without writing any code or not... If not, could you please help me building this to start?

thanks a lot
profile picture

Cone

#2
Hi Baris.
The Strategy Builder has a "Channel Breakouts" group of entries, but they use Stop orders, which isn't precisely what you want.

For this strategy you need the Highest and Lowest indicators. When you can't find ready-made conditions using the indicators you need, go to the "General Indicators" Conditions for something that works for you. All indicators can be selected there.

I've attached an image of one way to create the strategy with Rules. Even if it's not exactly what you want, it should be a good place to start.

profile picture

BarisKaya

#3
thanks Cone. No problems with the 1st part which is to trigger the trade when price closes above 20day highest close, but the problem is with the ATR stops. I.e. A trade is triggered at 50$ for a stock, and stock made a highest close of $70 after some time, and started coming off. My ATR Stop should be $70-3*ATR for 100 periods and stay there until a new high is made... this should keep the trade on until the stop is hit. In current situation, it calculates ATR every day with that days price so 3*ATR is very hard to get hit, and trade keeps open for a very long time which is not what i want. please help

thank you
profile picture

Cone

#4
This is where you'll have to leave the wizard and modify the code yourself. Since I didn't save my work from above, kindly click the "Open Code in new Strategy Window" button and save it. Copy the code from the Strategy Window Editor, and then reply here by clicking the code button [#] and then paste the code between the code tags to Post it.