Gann Market Model Short Term Correction strategy / M1 TIMEFRAME

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #76102 quote
    noisettenoisette
    Participant
    Veteran

    Thanks Odin sharing you strategy:

    https://www.prorealcode.com/prorealtime-trading-strategies/gann-market-model-short-term-correction-strategy/

    I made some tests with M1 timeframe  and DAX and results are interesting.

    Main modifications:

    • Average periods are différents.
    • Adding a stoploss.
    • Exit if C10 = 1 instead of 2.
    • Open trade during open market.
    • Exit at 10pm.
    • No trade friday.
    • No gain reinvesting.

    First tests with long strategy and have to test short trades.

    Regards.

     

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    n = 1
    //short term
    a1= ExponentialAverage[5](high)[1]
    b1=ExponentialAverage[5](low)[1]
    if customclose > a1 then
    c1 = 1
    Else
    IF customclose < b1 then
    c1=-1
    endif
    ENDIF
    if c1= -1 then
    D1 = a1
    
    ELSE
    D1=b1
    
    endif
    
    a2= ExponentialAverage[130](high)[1]
    b2=ExponentialAverage[130](low)[1]
    if customclose > a2 then
    c2 = 1
    Else
    IF customclose < b2 then
    c2=-1
    endif
    ENDIF
    if c2= -1 then
    D2 = a2
    
    ELSE
    D2=b2
    
    endif
    
    a3= ExponentialAverage[200](high)[1]
    b3= ExponentialAverage[200](low)[1]
    if customclose > a3 then
    c3 = 1
    Else
    IF customclose < b3 then
    c3=-1
    endif
    ENDIF
    if c3= -1 then
    D3 = a3
    
    ELSE
    D3=b3
    
    endif
    
    if D1 < close then
    result = 1
    else
    result = 0
    endif
    
    if D2 < close then
    result1 = 1
    else
    result1 = 0
    endif
    
    if D3 < close then
    result2 = 1
    else
    result2 = 0
    endif
    
    c10 = (result+result1+result2)
    
    // Bedingungen zum Einstieg in Long-Positionen
    
    IF c10 > 2 and time >= 091500 and time < 173100 AND DAYOFWEEK <> 5 THEN
    BUY n shares AT MARKET
    ENDIF
    
    // Bedingungen zum Ausstieg von Long-Positionen
    IF c10 < 2  or time >220000 THEN
    SELL AT MARKET
    ENDIF
    
    SET STOP LOSS 15
    
    Nicolas thanked this post
    Gann-Market-Model-StrategyV2.itf GANN1.png GANN1.png
    #76356 quote
    noisettenoisette
    Participant
    Veteran

    And herewith the cod for short trades.

    I have only inverse the strategy and changed the stop loss value.

    I you have ideas to improve the strategy let me know.

    // Festlegen der Code-Parameter
    DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
    n = 1
    //short term
    a1= ExponentialAverage[4](high)[1]
    b1=ExponentialAverage[4](low)[1]
    if customclose > a1 then
    c1 = 1
    Else
    IF customclose < b1 then
    c1=-1
    endif
    ENDIF
    if c1= 1 then
    D1 = b1
    ELSE
    D1=a1
    
    endif
    
    a2= ExponentialAverage[130](high)[1]
    b2=ExponentialAverage[13O](low)[1]
    if customclose > a2 then
    c2 = 1
    Else
    IF customclose < b2 then
    c2=-1
    endif
    ENDIF
    if c2= 1 then
    D2 = b2
    ELSE
    D2=a2
    
    endif
    
    a3= ExponentialAverage[200](high)[1]
    b3= ExponentialAverage[200](low)[1]
    if customclose > a3 then
    c3 = 1
    Else
    IF customclose < b3 then
    c3=-1
    endif
    ENDIF
    if c3= 1 then
    D3 = b3
    ELSE
    D3=a3
    
    endif
    
    if D1 > close then
    result = 1
    else
    result = 0
    endif
    
    if D2 > close then
    result1 = 1
    else
    result1 = 0
    endif
    
    if D3 > close then
    result2 = 1
    else
    result2 = 0
    endif
    
    c10 = (result+result1+result2)
    
    // Bedingungen zum Einstieg in Long-Positionen
    
    IF c10 > 2 and time >= 091500 and time < 173100 AND DAYOFWEEK <> 5 THEN
    SELLSHORT n shares AT MARKET
    ENDIF
    
    // Bedingungen zum Ausstieg von Long-Positionen
    IF c10 < 1  or time >220000 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    SET STOP LOSS 20
    

     

     

    Regards.

    GANN2.png GANN2.png GannMMS-SHORTV2.itf
    #76359 quote
    noisettenoisette
    Participant
    Veteran

    Sorry: In the first code, you should read line 83: “if c10<1” instead of 2.

    attached itf are with variables.

Viewing 3 posts - 1 through 3 (of 3 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

Gann Market Model Short Term Correction strategy / M1 TIMEFRAME


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
noisette @noisette Participant
Summary

This topic contains 2 replies,
has 1 voice, and was last updated by noisettenoisette
8 years, 2 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/16/2018
Status: Active
Attachments: 4 files
ProRealCode ProRealCode
Loading...