open range strategy code – lot of success

Viewing 9 posts - 31 through 39 (of 39 total)
  • Author
    Posts
  • #48890 quote
    dillongr
    Participant
    Junior

    thanks Nicolas,  I just picked that up

    #49818 quote
    Leo
    Participant
    Veteran

    I coded this here with a profit target at the 161.8% fibo extension (that was already bad enough) and at least for the dax the result was not very promising. Here is the code if you want to play with it:

    Line 24 should be close< ema,

    This strategy sounds interesting, let me know if is working

    #49825 quote
    Despair
    Blocked
    Master

    You are right, there is a typo in the sell short part. Thanks!

    #51760 quote
    dillongr
    Participant
    Junior

    Here is a link to a webinair that talks about this strategy  https://brookstradingcourse.com/webinars-lectures/futures-io-webinar-trading-opening-breakouts-reversals/

    GraHal thanked this post
    #63247 quote
    dillongr
    Participant
    Junior

    Hi,  I have simplified my code, but have a small problem.  I only want orders to be placed within 10% of the bottom / top of range.  Range is the 2nd 4hr candles, and entry is based on 10 min bar closing outside the range. I am getting orders placed after I have taked profit, which is to far from the range.  any ideas how to solve that?

    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
    #63253 quote
    juanj
    Participant
    Master

    Problem is that new orders are being placed as soon as the ‘not onmarket’ condition becomes true again.

    Do you perhaps want to limit the strategy to only 1 profitable trade?

    #63255 quote
    juanj
    Participant
    Master

    Maybe try this, it will only create one set of stop orders for the day;

    defparam cumulateorders=false
    
    tradingtime=dayofweek>=1 and dayofweek<=5 and time>100000 and time <170000
    
    If hour = 1 Then
    TD = 1
    ElsIf hour = 10 and minute = 0 then
    RangeTop=highest[24](high)[1]
    RangeBottom=lowest[24](low)[1]
    endif
    
    box=RangeTop-RangeBottom
    TP1=box*1.1
    SL=box*0.8
    pricezoneS=rangebottom - (box*0.1)
    pricezoneL=rangetop + (box*0.1)
    
    If TD = 1 and on market Then
    TD = 0
    EndIf
    
    if TD = 1 and not onmarket and tradingtime then
    buy 2 contract at pricezoneL stop
    sellshort 2 contract at pricezoneS stop
    endif
    
    //set profit to range height
    SET TARGET pPROFIT TP1
    set stop ploss SL
    
    //GRAPH RangeTop coloured(255,0,0) AS "RangeTop"
    //GRAPH RangeBottom coloured(0,255,0) AS "RangeBottom"
    
    #63282 quote
    dillongr
    Participant
    Junior

    Thanks Juan,

    That still produces multiple orders,  I only want 1 long or 1 short per day.  Once target is hit, we wait for the next day.  I am using this on the GBP pairs manually right now with great success  (it is basically the London Breakout strategy)

    #63290 quote
    dillongr
    Participant
    Junior

    Ok got it like I wanted,  now to test on GBP pairs

    defparam cumulateorders=false
    once order = 0
    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])
    order = 0
    endif
    
    box=RangeTop-RangeBottom
    TP1= box*1.5
    SL=box*1.1
    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 not order and tradingtime then
    if entryl   then
    buy 1 contract at market
    order = 1
    
    //tc=1
    elsif entrys   then
    sellshort 1 contract at market
    order = 1
    
    //tc=1
    endif
    
    endif
    
    
    //set profit to range height
    
    SET TARGET PROFIT TP1
    
    
    
    
    set stop loss SL
    
    GraHal thanked this post
Viewing 9 posts - 31 through 39 (of 39 total)
  • You must be logged in to reply to this topic.

open range strategy code – lot of success


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
dillongr @dillongr Participant
Summary

This topic contains 38 replies,
has 10 voices, and was last updated by dillongr
7 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/08/2017
Status: Active
Attachments: 7 files
Logo Logo
Loading...