Strategy based on ATR calculated RENKO

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #175108 quote
    ProRealP
    Participant
    Senior

    Hello!

    I’m trying to create a system based on atr calculated renko. I found an indicator in an old thread and tried to use that.

    Defparam cumulateorders = false
    positionsize = 1
    
    boxsize = AverageTrueRange[14](close)
    Period = 1000
    boxsize = average[period]
     
    once topprice = close
    once bottomprice = close - boxsize
     
    if(high > topprice + boxsize*2) THEN
    topprice = close
    bottomprice = topprice - boxsize*2
    ELSIF (low < bottomprice - boxsize*2) THEN
    bottomprice = close
    topprice = bottomprice + boxsize*2
    ELSE
    topprice = topprice
    bottomprice = bottomprice
    ENDIF
    
    If topprice + boxSize then
    buy positionsize contracts at market
    endif
    
    If bottomprice - boxSize then
    sellshort positionsize contracts at market
    endif

    It works for going long, but won’t sell short, and I can’t figure out why. Any ideas?
    Thanks!

    #175111 quote
    GraHal
    Participant
    Master

    You appear to have 2 values for boxsize …

     

    boxsize = AverageTrueRange[14](close)
    Period = 1000
    boxsize = average[period]
    
    ProRealP thanked this post
    #175119 quote
    ProRealP
    Participant
    Senior

    Silly me! Too much copy/paste.

    It works now when using the ATR.

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

Strategy based on ATR calculated RENKO


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
ProRealP @prorealpierre Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by ProRealP
4 years, 6 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/11/2021
Status: Active
Attachments: No files
Logo Logo
Loading...