Need help for a renko based strategy (Nicholas i need u)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #44118 quote
    edored
    Participant
    New

    I wrote a code to trade renko pullbacks in the daily chart, but it doesn’t function, someone can please help? I know the code is realy rude but it’s the first time for me to coding, be patient to understand it.

    renkoboxsize = 0.0085 // DIMENSIONE COSTANTE IN PIPS DEL BOX RENKO
    count = 0
    i = 0
    boxes1 = 0
    boxes2 = 0
    actualbox = 0
    
    
    
    // Controlliamo se il box attuale è verde o rosso
    WHILE (count = 0)
    sum = close[i] - close[i + 1] + sum
    
    
    IF sum >= renkoboxsize THEN
    
    actualbox = 1 // Il box attuale è verde
    boxes1 = boxes1 + 1
    count = 1
    ELSE
    IF sum <= renkoboxsize * -1 THEN
    
    actualbox = 2 // Il box attuale è rosso
    boxes1 = boxes1 + 1
    count = 1
    
    ENDIF
    ENDIF
    
    i = i + 1
    WEND
    sum = 0
    
    count = 0
    
    // Il box precedente a quello attuale deve essere di colore opposto, verifichiamolo:
    
    WHILE (count = 0 )
    
    sum = close[i] - close[i + 1] + sum
    
    
    
    IF sum >= renkoboxsize * 2 AND actualbox = 2 THEN
    
    verify = 2 // Il trend deve essere negativo
    boxes1 = boxes1 + 1
    count = 1
    
    
    
    ELSE
    
    IF sum <= renkoboxsize * -2 AND actualbox = 1 THEN
    
    verify = 1 // Il trend deve essere positivo
    boxes1 = boxes1 + 1
    count = 1
    
    
    
    
    ENDIF
    
    ENDIF
    
    i = i + 1
    WEND
    sum = 0
    
    count = 0
    
    // Ora dobbiamo andare a ritroso per verificare in che trend ci troviamo
    if verify = 1 THEN
    While count = 0
    sum = close[i] - close[i + 1] + sum
    if sum <= renkoboxsize * -1 THEN
    boxes1 = boxes1 + 1
    sum = 0
    ENDIF
    if sum >= renkoboxsize * 2 THEN
    count = 1
    ENDIF
    i = i + 1
    WEND
    count = 0
    sum = 0
    while count = 0
    sum = close[i] - close[i + 1] + sum
    if sum >= renkoboxsize then
    boxes2 = boxes2 + 1
    sum = 0
    ENDIF
    if sum <= renkoboxsize * -2 then
    count = 1
    boxes2 = boxes2 + 1
    endif
    i = i + 1
    WEND
    sum = 0
    count = 0
    endif
    if verify = 2 THEN
    While count = 0
    sum = close[i] - close[i + 1] + sum
    if sum >= renkoboxsize  THEN
    boxes1 = boxes1 + 1
    sum = 0
    ENDIF
    if sum <= renkoboxsize * -2 THEN
    count = 1
    ENDIF
    i = i + 1
    WEND
    count = 0
    sum = 0
    while count = 0
    sum = close[i] - close[i + 1] + sum
    if sum <= renkoboxsize * -1 then
    boxes2 = boxes2 + 1
    sum = 0
    ENDIF
    if sum >= renkoboxsize * 2 then
    count = 1
    boxes2 = boxes2 + 1
    endif
    i = i + 1
    WEND
    sum = 0
    count = 0
    endif
    
    IF verify = 1 AND  CountofLongShares = 0  AND CountofShortShares = 0 THEN
    IF boxes1  <= boxes2  THEN
    
    BUY 1 SHARES AT MARKET
    SET TARGET PROFIT 850
    SET STOP LOSS 1720
    ENDIF
    ENDIF
    
    IF verify = 2 AND CountofLongShares = 0  AND CountofShortShares = 0 THEN
    IF boxes1  <= boxes2  THEN
    
    SELLSHORT 1 SHARES AT MARKET
    SET TARGET PROFIT 850
    SET STOP LOSS 1720
    endif
    endif
    
    renko-ibm-1.png renko-ibm-1.png
    #44133 quote
    edored
    Participant
    New

    The renko box size in the code is used in EUR/USD and the backtest must be done form 2 years ago. TY

    #44143 quote
    Jessar
    Participant
    Senior

    Glaube sie nicht das sie bei solchen takeprofit und stoplos zielen sehr hohe übernacht kosten bekommen werden?

    Do not you think they will get very high overnight costs at such takeprofit and stoplos?

    #44145 quote
    edored
    Participant
    New

    Jess non conosco il tedesco ma credo che tu mi abbia chiesto se non credo che il risk/reward sia a mio svantaggio. Ovvio. Ma se guardi il grafico giornaliero da due anni fa fino ad oggi con un valore unità renko di 0.0085 ci sono più di una decina di segnali e tutti in profitto quindi niente falsi segnali. Keep it simple

    Jess do not know German but I think you asked me if I do not think risk / reward is to my disadvantage. Obvious. But if you look at the daily chart from two years ago to today with a renko unit value of 0.0085 there are more than a dozen signals and all in profit thus no false signals. Keep it simple

    #44235 quote
    Nicolas
    Keymaster
    Master

    Please guys, I’m not here to translate all your posts in the correct forum language! This is the English forum, please speak in English!! Thank you 😉


    @edored

    I’m sorry but your code is not so clear. Why are you making so much WHILE/WEND loops? It may have sense for you, but I still don’t get it myself sorry 🙂

    About your post:

    and the backtest must be done form 2 years ago. TY

    I can help for sure to create code for you, but you’ll have to make test on your own of course.

    So, in order to help you with speed and efficiency, could you please describe the whole strategy in English words? Screenshot like you made in your first post is greatly appreciated.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Need help for a renko based strategy (Nicholas i need u)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
edored @edored Participant
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Nicolas
8 years, 6 months ago.

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