BB Trading one Long one Short on DAX 9-17,30

Forums ProRealTime English forum ProOrder support BB Trading one Long one Short on DAX 9-17,30

Viewing 3 posts - 1 through 3 (of 3 total)
  • #236385

    Hello,

    i have build a programm which poorly didn’t work. Can someone help me?

    It didn’t accept the filters from day before

    It do more than one Trade in one direction

     

     

    I use the Dax Future 9-1730

    a) for the Filter of day candle

    b) for creat the 5 minut BB

    c) for Backtesting i take the one minute Chart and 1.000.000 candles

    Here is the code with the explain of filter, stop etc.

    Thank you very much

    defparam preloadbars=5000
    defparam cumulateorders=false
    size=(100000+strategyprofit)/(close)*3

     

    //Trading Time for start
    if time=>090000 and Time<124000 THEN
    t=1
    ELSE
    t=0
    ENDIF
    //Parameter from Yesterday for Starting Conditions
    Timeframe(daily)
    //Range >0,6%
    c101=(high-low)/close*100>0.6

    //Strong Cande with body of a minimum of 50%
    if open>close then
    c102=(open-close)/(high-low)>0.5
    else
    c102=(close-open)/(high-low)>0.5
    endif

    //Use BB of 5 Min Chart
    timeframe(5 minutes,updateonclose)
    Bolld=ExponentialAverage[21](open)-2*std[21](open)
    Bollu=ExponentialAverage[21](open)+2*std[21](open)

    // Only on Long Trade and one Short Trade a day
    timeframe (5 minute)

    c1=(high[0]> BOLLU)
    c2=(low[0]< BOLLD)
    MaxTrades = 1
    IF IntraDayBarIndex = 0 THEN
    LongTally = 0
    ShortTally = 0
    Endif

    if not SHORTONMARKET and c1 and t=1 and ShortTally<Maxtrades then
    SELLSHORT size contracts at market
    ShortTally = ShortTally + 1
    ENDIF

    //Close Position on 1730 when not SL or TP
    if SHORTONMARKET and close<Average[21] or time>173000 THEN
    EXITSHORT at market
    ENDIF

    //Stop Conditions
    if shortonmarket THEN
    SET STOP LOSS AverageTrueRange[5](close)*2.0
    ENDIF

    if not longONMARKET and c2 and t=1 and LongTally<MaxTrades THEN
    buy size contracts roundedup AT MARKET
    LongTally = LongTally + 1
    ENDIF

     

    if longonmarket THEN
    SET STOP LOSS -AverageTrueRange[5](close)*2.0
    ENDIF

    if LONGONMARKET and close>Average[21] or time>173000 THEN
    sell AT MARKET
    ENDIF

    #236386
    #236397

    Hello!
    I’ve slightly modified the code while keeping most of your original proposal. Now the system only makes one trade in each direction per day at most. Here is the code:

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login