Strategy based on ATR calculated RENKO

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #175108 quote
    ProRealPProRealP
    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
    GraHalGraHal
    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
    ProRealPProRealP
    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.
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

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 ProRealPProRealP
5 years, 1 month ago.

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