Comment on Code your Technical Analysis strategy

Trader_Junior commented on 22 Sep 2013, 11:55 PM

Dear Zerodha,

I would like to know if the following strategy (or something similar) could be coded:

The idea is to scale-in the trades as price action runs in our favor, to maximize profits due to proper pyramiding, decreasing the impact of unprofitable trading decisions. The script would have to do something like that (Doesnt have to be exactly this but something similar that could be transformed into a code):

Buy at market price and place 3 further pending orders
Sell at market price and place 3 further pending orders
Place a buy stop order at the high of the previous bar and 3 further pending orders
Place a sell stop order at the low of the previous bar and 3 further pending orders

Some other facts you should know:

The first trade has a risk allocation of 2%.
All further pending orders decrease in lotsize to avoid overbetting.
All orders have an ATR-based stop-loss. Default is ATR(30)*2 from the opening price.
All pending orders have an ATR-based distance between them. Default is ATR(30)/2.

Here are some images:

Thank you in advance

View the full comment thread »