Announcement

Collapse
No announcement yet.

Rising and declining indicator colors

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rising and declining indicator colors

    Hi all,

    I'm an Italian trader and I am newbie for esignal.
    I red the thread of Alexis and I much appreciated the post regarding color plotting using his custom array library.
    I tried to do the same for all trend indicator like simple moving average, instantaneous trend etc... without success.
    Are there available methods that permit to Highlight rising and declining issue using a[0]>a[1] and a[1]>a[2] etc..?

    many Thanks for the suggestions....

    Regards

    Valerio Rinaldi

  • #2
    Valerio
    If you are using builtin studies or custom studies that are created using the efsExternal() or efsInternal() functions (which return a series) then you can retrieve their historical values directly through the getValue() method and you do not need to use an array. See the example enclosed below which shows how to define a rising moving average
    Alex

    PHP Code:
    var myStudy sma(10,close());//10 period simple moving average of the Close
    //IF the current value of the average is greater than the value of the average at the prior bar AND 
    //the value of the average at the prior bar is greater than that of two bars ago...etc etc
    if(myStudy.getValue(0) > myStudy.getValue(-1) && myStudy.getValue(-1) > myStudy.getValue(-2)){ 

    Comment


    • #3
      Many Thanks Alexis

      I will work on that way....

      Thanks for the amazing works


      Regards

      Valerio Rinaldi

      Comment


      • #4
        Valerio
        My pleasure and thank you for the compliment.
        If you have a script in which you are trying to use the ezArray() function and that does not work post the code (or attach the efs) and I will give it a look.
        Alex

        Comment

        Working...
        X