Ichimoku W Max ADX stop K/SB

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #124268 quote
    inavsan
    Participant
    New

    Backtest with Ichimoku, Maximum 36 periods, ADX, MACD and stop with Ichimoku, MACD and %Williams

    DEFPARAM CumulateOrders=False
    DEFPARAM NOCASHUPDATE = False
    
    REM Comprar/Comprare/Acheter/Buy
    myKijun, myTenkan, myChikou, mySpanA, mySpanB = CALL "Ign Ichimoku 1"[0](close)
    
    c1 = (Close > myTenkan)
    c2 = (Close > myKijun)
    c3 = (Close > mySpanA)
    c4 = (Close > mySpanB)
    c5 = (Close > Close[26])
    c6 = (MACDline[12,26,9](close) > 0)
    c61 = (MACDline[12,26,9](close) > MACDSignal[12,26,9](close))
    c7 = (Close = highest[n] (close))
    c8 = (ADX[14] > ADX[14][1])
    c9 = (ADX[14] > DIminus[14](close))
    c10 = (DIplus[14](close) > DIminus[14](close))
    
    IF c1 and c2 and c3 and c4 and c5 and c6 and c61 and c7 and c8 and c9 and c10 THEN
    BUY 1000 cash AT MARKET
    ENDIF
    
    coste = tradeprice
    
    REM Vender/Vendere/Vendre/Sell
    
    if (coste > myKijun) then
    myStop = myTenkan
    elsif (coste < myKijun) and (coste > mySpanB) then
    myStop = myKijun
    elsif (coste < mySpanB) then
    myStop = mySpanB
    endif
    
    IF close < myStop or Williams[14](close) < -80 or MACDline[12,26,9](close) < 0 THEN
    sell at market
    //SELL AT myStop STOP
    ENDIF
    captura-de-pantalla-de-1585758194pl4c8.png captura-de-pantalla-de-1585758194pl4c8.png Ichimoku-W-Max-ADX-stop-K-SB.itf captura-de-pantalla-de-1585758194pl4c81.png captura-de-pantalla-de-1585758194pl4c81.png Ichimoku-W-Max-ADX-stop-K-SB1.itf
    #124767 quote
    Nicolas
    Keymaster
    Master

    Hi! Thanks for sharing your trading strategy idea. Would you mind to tell us more about it please? What is the timeframe to be used? And for what instrument? It seems to work well on major trend, by looking at the picture you provide! 🙂

    #124779 quote
    GraHal
    Participant
    Master

    Line 13 is incorrect, MACDSignal is not a PRT recognised Indicator (it should be … it would make our lives easier!?)

    Surely it can only work if coded as …

    c61 = (MACDline[12,26,9](close)) > ExponentialAverage[9](MACDline[12,26,9](close))
    #124794 quote
    Vonasi
    Moderator
    Master

    MACDSIGNAL is now an instruction in PRTv11.

    MACDsignal

    I think we might be reaching the time where it would be useful if people mentioned the version number if they coded it on v11.

    GraHal thanked this post
    #124821 quote
    inavsan
    Participant
    New

    Dear Nicolas,

    Only for Weekly, confirmed with monthly.

    I send you a indicator than can help you for decissions.

    I work only with sotcks and I select only the best stocks for financials, growth and moat.

    If you need something else write me.

    I apologize for my bad english. I’m spanish 😉

    #124824 quote
    inavsan
    Participant
    New

    I backtested more and I changed a few things.

    Now the code is enhanced.

    I work on weekly, but I compare each signal with monthly for confirmation.

    Nicolas thanked this post
    Ichimoku-W-Max-ADX-stop-K.itf Signal-Ichi-W-adx-macd.itf
    #124832 quote
    GraHal
    Participant
    Master

    Anybody else tried this on v10.3?

    Trying with the latest codes above, I get  the attached errors. (The original code on the original post had similar errors also).

    Even if I include below then more errors messages show … e.g. cc is not used.

    If MyChikou or my0 OR Mybs or mybi or mycoste Then
    Endif

     

     

    @inavsan  does the above code work perfectly fine on your Platform??

    inavsan.jpg inavsan.jpg
    #124846 quote
    GraHal
    Participant
    Master

    Update:

    I’ve got it working now after making a few changes here and there.

    I will post the amended code shortly … results looks good!!

    bertrandpinoy thanked this post
    #124852 quote
    Zigo
    Participant
    Master

    Ichimoku is a very good indicator on its own. I think it doesn’t need any other indicator.

    Therfore I have tested it without Macd and ADX (green) (c1, c2, c3, c4 and c5)

    and also with Macd and ADX (bleu) (c1, c2, c3, c4, c5, c6, c61, c7, c8, c9 and c10)

    DEFPARAM CumulateOrders=False
    DEFPARAM NOCASHUPDATE = False
    once n= 9
    once m= 3*n-1
    
    REM Comprar/Comprare/Acheter/Buy
    
    myTenkan=(highest[n](high)+lowest[n](low))/2
    myKijun=(highest[m](high)+lowest[m](low))/2
    myspanA=(myTenkan+myKijun)/2
    mySpanB=(highest[2*m](high)+lowest[2*m](low))/2
    c1 = (Close > myTenkan)
    c2 = (Close > myKijun)
    c3 = (Close > mySpanA)
    c4 = (Close > mySpanB)
    c5 = (Close > Close[26])
    
    IF c1 and c2 and c3 and c4 and c5 THEN
    BUY 1 contract AT MARKET
    ENDIF
    
    coste = tradeprice
    
    REM Vender/Vendere/Vendre/Sell
    
    if (coste > myKijun) then
    myStop = myTenkan
    elsif (coste < myKijun) and (coste > mySpanB) then
    myStop = myKijun
    elsif (coste < mySpanB) then
    myStop = mySpanB
    endif
    
    IF close < myStop or Williams[14](close) < -80 or MACDline[12,26,9](close) < 0 THEN
    sell at market
    //SELL AT myStop STOP
    ENDIF
    Inavsan.png Inavsan.png
    #124854 quote
    GraHal
    Participant
    Master

    Thank You inavsan for sharing your code with us all … jolly decent of you! 🙂

    Results attached with spread = 7.

    If you make improvements, please post here.

    inavsan-2.jpg inavsan-2.jpg inavsan-3.jpg inavsan-3.jpg Ichimoku-W-Max-ADX-stop-K-1.itf
    #124862 quote
    Zigo
    Participant
    Master
    #124865 quote
    GraHal
    Participant
    Master

    How long term … you don’t show bottom line so we cant see how many years? 🙂

    Do you mean 200k bars and what is the TF – 3 uren … is that 3 hours?

    #124868 quote
    Zigo
    Participant
    Master

    Sorry

    GraHal thanked this post
    Inavsan-DJ.png Inavsan-DJ.png
    #124896 quote
    Zigo
    Participant
    Master
    DEFPARAM CumulateOrders=False
    DEFPARAM NOCASHUPDATE = False
    once n= 9
    once m= 3*n-1
    
    REM Comprar/Comprare/Acheter/Buy
    
    myTenkan=(highest[n](high)+lowest[n](low))/2
    myKijun=(highest[m](high)+lowest[m](low))/2
    myspanA=(myTenkan+myKijun)/2
    mySpanB=(highest[2*m](high)+lowest[2*m](low))/2
    c1 = (Close > myTenkan)
    c2 = (Close > myKijun)
    c3 = (Close > mySpanA)
    c4 = (Close > mySpanB)
    c5 = (Close > Close[26])
    c6 = Close < mytenkan
    c7 = close < myKijun
    c8 = close < mySpanA
    c9 = close < mySpanB
    c10= close < close[26]
    
     
    IF c1 and c2 and c3 and c4 and c5  THEN
    BUY 1 contract AT MARKET
    ENDIF
     
    coste = tradeprice
     
    REM Vender/Vendere/Vendre/Sell
     
    if (coste > myKijun) then
    myStop = myTenkan
    elsif (coste < myKijun) and (coste > mySpanB) then
    myStop = myKijun
    elsif (coste < mySpanB) then
    myStop = mySpanB
    endif
     
    IF close < myStop or Williams[14](close) < -80 or MACDline[12,26,9](close) < 0 THEN
    sell at market
    //SELL AT myStop STOP
    ENDIF
    
    If c6 and c7 and c8 and c9 and c10 then
    sellshort 1 contract at market
    endif
    //Kost Verkoop is KV
    KV = Tradeprice
    
    if (KV < myKijun) then
    myStop = myTenkan
    elsif (KV > myKijun) and (KV < mySpanB) then
    myStop = myKijun
    elsif (KV > mySpanB) then
    myStop = mySpanB
    endif
     
    IF close < myStop or Williams[14](close) < -80 or MACDline[12,26,9](close) < 0 THEN
    sell at market
    //SELL AT myStop STOP
    ENDIF
    GraHal thanked this post
    DOW-Both-long-short-2-uren.png DOW-Both-long-short-2-uren.png
    #124902 quote
    inavsan
    Participant
    New

    Dear Grahal,

    I only work weekly.

    My backtests are made from the begin of data (about 1995) from the last dat available.

    I only work with V11.

    GraHal thanked this post
Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.

Ichimoku W Max ADX stop K/SB


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
inavsan @inavsan Participant
Summary

This topic contains 16 replies,
has 6 voices, and was last updated by Fran55
5 years, 10 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 04/06/2020
Status: Active
Attachments: 12 files
Logo Logo
Loading...