Announcement

Collapse
No announcement yet.

Average True Range Indicator

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Average True Range Indicator

    Hi,

    I use the following code in Easylanguage.
    But I would like to use the same indicator with esignal.

    Is there anyone who could help out with the correct esignal code ?

    The indicator should color the bars when AverageTrueRange is greater than the highest AverageTrueRange since x no. of bars.

    Hopefully someone can give me a hand.

    Thanks, Larssa


    inputs: Length( 20 ), ATRLength( 14 ) ;
    variables: var0( 0 ), var1( 0 ) ;

    var0 = Lowest ( AvgTrueRange( ATRLength ), Length )[1] ;
    var1 = Highest( AvgTrueRange( ATRLength ), Length )[1] ;

    if AvgTrueRange( ATRLength ) > var1 and AvgTrueRange( ATRLength ) > 20 then

    begin
    PlotPaintBar(High,Low,Open,Close,"",DarkGreen,Dark Green,2);
    end ;

  • #2
    Re: Average True Range Indicator

    Larssa
    You can easily create the same in eSignal using the atr() function and then passing that series to the highest() and lowest() functions.
    For the description, syntax and some examples of the use of these functions see the links to the related articles in the EFS KnowledgeBase. Also see this thread for some additional examples of nested studies on studies using series functions
    Alex


    Originally posted by larssa
    Hi,

    I use the following code in Easylanguage.
    But I would like to use the same indicator with esignal.

    Is there anyone who could help out with the correct esignal code ?

    The indicator should color the bars when AverageTrueRange is greater than the highest AverageTrueRange since x no. of bars.

    Hopefully someone can give me a hand.

    Thanks, Larssa


    inputs: Length( 20 ), ATRLength( 14 ) ;
    variables: var0( 0 ), var1( 0 ) ;

    var0 = Lowest ( AvgTrueRange( ATRLength ), Length )[1] ;
    var1 = Highest( AvgTrueRange( ATRLength ), Length )[1] ;

    if AvgTrueRange( ATRLength ) > var1 and AvgTrueRange( ATRLength ) > 20 then

    begin
    PlotPaintBar(High,Low,Open,Close,"",DarkGreen,Dark Green,2);
    end ;

    Comment


    • #3
      Hello,

      thank you for the reply, I've tried to use the code in your link but it feels that it's to much coding for me...
      I wrote the MultiCharts code myself and thought it would be easy to translate it, (just a few lines) but I understand now it's a lot of work.

      Thanks anyway.

      Comment


      • #4
        Larssa
        I fail to see how this would be any more difficult or more work than what you wrote



        FWIW the above snippet is the equivalent efs code [in its most basic form] of your conditional statement.
        Perhaps you may want to spend some more time reviewing the articles and thread I linked in my prior reply
        Alex


        Originally posted by larssa View Post
        Hello,

        thank you for the reply, I've tried to use the code in your link but it feels that it's to much coding for me...
        I wrote the MultiCharts code myself and thought it would be easy to translate it, (just a few lines) but I understand now it's a lot of work.

        Thanks anyway.

        Comment


        • #5
          Originally posted by Alexis C. Montenegro View Post
          Larssa
          I fail to see how this would be any more difficult or more work than what you wrote



          FWIW the above snippet is the equivalent efs code [in its most basic form] of your conditional statement.
          Perhaps you may want to spend some more time reviewing the articles and thread I linked in my prior reply
          Alex
          Thank you so much!!!!

          Comment


          • #6
            Larssa
            You are welcome
            Alex


            Originally posted by larssa View Post
            Thank you so much!!!!

            Comment

            Working...
            X