BREAKOUT / BREAKDOWN FROM A RANGE
- This topic has 4 replies, 4 voices, and was last updated 7 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
Similar topics:
Forums › ProRealTime English forum › ProOrder support › BREAKOUT / BREAKDOWN FROM A RANGE
Hello Everyone
May I please ask for any ideas or code snippets to get me started or even a full ‘Auto System’ to perform the following …
Breakout or Breakdown from a Range.
The sort of range I am thinking of are usually tightish / narrowish and often seen as consolidation after a strong rise up or down.
Please refer me to any existing systems on this website or anywhere that you feel may do the job?
Hope above makes sense, just say if not.
Many Thanks
GraHal
Hello GraHal,
This is not very difficult to code this kind of strategy, but how you would define a range after a strong rise up or down? A range is easy to spot with charts in front of human eyes, but not so with a mathematical process and that’s where the problem is. I would say that bollinger bandwidth may do the job for what you want to do here, take a look on it and maybe try to build a strategy around it.
Hi GraHal,
As Nicolas says, what are the exact specifications for this range? Start by defining these as simple text and then we could help you turn it into code. Something like (on a day chart):
Something like that…
Hi Guys and thank you both for your suggestions.
As an example, I was thinking …
Breakout above highest high over N2 bars – go Long.
Breakdown below lowest low over N2 bars then SellShort.
I would use PositionPerf = – N3 to get me out of the Trade.
I often trade manually as above and it more often than not gives me profit if I am nimble enough to get out before it retraces too much!
I would use backtest to optimise the value of N, N1, N2 and N3.
Many Thanks
GraHal
Morning, I have been playing with this again and have simplified the code but I only want orders to be placed within 10% of the break of the range. Right now new orders get placed as soon as I take profit, any ideas how to make sure that does not happen? this is the current code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
defparam cumulateorders=false tradingtime=dayofweek>=1 and dayofweek<=5 and time>100000 and time <170000 if time=100000 then RangeTop=highest[24](high[1]) RangeBottom=lowest[24](low[1]) endif box=RangeTop-RangeBottom TP1=box*1.1 SL=box*.8 pricezoneS=rangebottom*0.9 pricezoneL=rangetop*1.1 //TP2=box*1.62 //TP3=box*2 entryl= close >= rangetop and close <= pricezonel entrys=close<= rangebottom and close >= pricezones if not onmarket and tradingtime then if entryl then buy 1 contract at market //tc=1 elsif entrys then sellshort 1 contract at market //tc=1 endif endif //set profit to range height SET TARGET PROFIT TP1 set stop loss SL |
Find exclusive trading pro-tools on