Dax-10sec automated trading strategy

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #138544 quote
    alex20258alex20258
    Participant
    Average

    I found this code on the forum, dates back to a few years ago, I have optimized it for the current period; thanks to the code writer, I can’t remember the name, he works on the timeframe at 10seconds, with a very fast take profit to have a linear gain curve, he also works only in periods of time (9-17.30) when the spread is low ( 1.2)
    if you can optimize it still write directly here on the forum, I sent it to test today, and already managed to earn 50 euros in less than 4 hours,
    Thank you

    Alex

    //SPEAD = 2.5
    //Capital = £500
    //Trading hours from DAX open until NYSE close. No after hours trading.
    //Time is UTC +2 (South Afica time)
     
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
     
    // Prevents the system from creating new orders to enter the market or increase position size before the specified time
    noEntryBeforeTime = 090000
    timeEnterBefore = time >= noEntryBeforeTime
     
    // Prevents the system from placing new orders to enter the market or increase position size after the specified time
    noEntryAfterTime = 173000
    timeEnterAfter = time < noEntryAfterTime
     
    // Conditions to enter long positions
    indicator1 = WeightedAverage[25](totalPrice)
    c1 = (High CROSSES OVER indicator1)
    indicator2 = WeightedAverage[79](totalPrice)
    c2 = (low CROSSES OVER indicator2)
     
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter THEN
    Buy 1 CONTRACT AT MARKET
    ENDIF
    
    indicator3 = WeightedAverage[25](totalPrice)
    c3 = (low CROSSES UNDER indicator3)
    indicator4 = WeightedAverage[79](totalPrice)
    c4 = (High CROSSES UNDER indicator4)
     
    IF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter THEN
    SellShort 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops and targets
    SET TARGET $PROFIT 9

     

     

    Paul and LiWic thanked this post
    daxxx-10sec.itf daxxxsec-1594029935p4l8c.png daxxxsec-1594029935p4l8c.png daxxx-10sec-1.itf daxxxsec-1594029935p4l8c-1.png daxxxsec-1594029935p4l8c-1.png
    #138825 quote
    NicolasNicolas
    Keymaster
    Legend

    Hi Alex, thanks for sharing. There is no stoploss in the strategy, only contrarian orders can close an order in a loss and therefore if it doesn’t happen it could lead on huge drawdown of your account. So any optimized values could also lead to the same equity curve, I’m sorry.

    #138828 quote
    alex20258alex20258
    Participant
    Average

    Hello nicolas,
    thanks for the reply, i’m now working on the version with the stop loss; From monday he made 400 euros in germany 30(€5) that costs 3.2k (ig version); i’ll probably put a distante stoploss in the case the robot buy at a maximum or at a minium; working on the 10 sec the limit sales points are practically always touched; however, even a distant stoploss obviously has to be added for safety, i update you soon

    Thanks

    Alex

    GraHal thanked this post
    #139337 quote
    NicolasNicolas
    Keymaster
    Legend

    Hi Alex, if you don’t mind please update the strategy here with the new versions instead of posting them directly in the library, thanks 🙂

    #139349 quote
    alex20258alex20258
    Participant
    Average

    ok,thank you nicolas,

    here you have a new version of the code, it always works on the 10sec dax

    i’m now testing it with different x,y,z

    i keep you update if i find the perfect Combination

    //-------------------------------------------------------------------------
    // Codice principale : nn si sa m.a. colorata bull
    //-------------------------------------------------------------------------
    //SPEAD = 2.5
    //Capital = £500
    //Trading hours from DAX open until NYSE close. No after hours trading.
    //Time is UTC +2 (South Afica time)
    
    DEFPARAM CumulateOrders = false // Cumulating positions deactivated
    
    a=average[z] (close)
    if a[1]<a then
    alex=100
    endif
    
    if a[1] > a then
    alex=50
    endif
    
    // Prevents the system from creating new orders to enter the market or increase position size before the specified time
    noEntryBeforeTime = 090000
    timeEnterBefore = time >= noEntryBeforeTime
     
    // Prevents the system from placing new orders to enter the market or increase position size after the specified time
    noEntryAfterTime = 173000
    timeEnterAfter = time < noEntryAfterTime
     
    // Conditions to enter long positions
    indicator1 = WeightedAverage[x](totalPrice)
    c1 = (High CROSSES OVER indicator1)
    indicator2 = WeightedAverage[y](totalPrice)
    c2 = (low CROSSES OVER indicator2)
     
    IF (c1 AND c2) AND timeEnterBefore AND timeEnterAfter and COUNTOFPOSITION=0 and alex=100 THEN
    Buy 1 CONTRACT AT MARKET
    ENDIF
    
    indicator3 = WeightedAverage[x](totalPrice)
    c3 = (low CROSSES UNDER indicator3)
    indicator4 = WeightedAverage[y](totalPrice)
    c4 = (High CROSSES UNDER indicator4)
     
    IF (c3 AND c4) AND timeEnterBefore AND timeEnterAfter and COUNTOFPOSITION=0 and alex=50 THEN
    SellShort 1 CONTRACT AT MARKET
    ENDIF
    
    // Stops and targets
    SET TARGET $PROFIT 10
    SET STOP $LOSS 200
    

    thanks

     

    Alex

    angelpero thanked this post
    nn-si-sa-m.a.-colorata-bull.itf
    #164326 quote
    MattiasMattias
    Participant
    Senior

    How’s it going with this one alex20258?

    angelpero thanked this post
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Dax-10sec automated trading strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
alex20258 @alex20258 Participant
Summary

This topic contains 5 replies,
has 3 voices, and was last updated by MattiasMattias
5 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/09/2020
Status: Active
Attachments: 5 files
ProRealCode ProRealCode
Loading...