Announcement

Collapse
No announcement yet.

How to Change colour of indicator

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

  • How to Change colour of indicator

    Question regarding writing a EFS study to change indicator colour.

    For example 2 moving averages. fast MA crosses above slow MA then colour of slow MA indicator changes to green. Fast MA crosses below slow MA then slow MA changes to red.

    Any suggestions certainly appreciated.

  • #2
    jzolty
    The attached efs should do what you asked.
    All parameters for both moving averages can be modified through Edit Studies
    Alex

    Attached Files

    Comment


    • #3
      Thanks Alexis

      Alexis thank you for your reply.
      This will help.
      Merry Christmas to ya.
      Jack

      Comment


      • #4
        Alexis I tried to alter my TSI code using your MA example and hit a brick wall.

        The Ergodic TSI indicator plots two lines.
        I'm trying to :
        1) plot a colour change on the signal line when the TSI line turns up/down compared to one bar ago. TS easylangue example TSIline>TSIline[1] then change colour of signal line.
        2) only plot the signal line not the TSI line.
        3)plot user defined Overbought and oversold lines.

        Sure could use your help on this...

        thanks,
        Jack

        Comment


        • #5
          Alexis.. TSI Attatchment

          Attatchment didn't seem to send. I hope this get through.
          Attached Files

          Comment


          • #6
            Jack
            The attached revision of the efs should include all the changes you requested.
            The Overbought and Oversold levels are set by default at 10 and -10 respectively (in lines 117 and 123) and can be modified through Edit Studies
            All the modifications are commented in the efs, but if you need any further explanation feel free to ask.
            Alex
            Attached Files

            Comment


            • #7
              Jack
              A Merry Christmas to you too
              Alex

              Comment


              • #8
                Alexis

                Alexis,
                one more quickie,

                how do I get the signal line to change colour when the signal line changes direction. and not when the nTSI line changes direction like it is written now??

                I sure appreciate your help

                Comment


                • #9
                  Jack
                  Replace this section

                  if(nTSI>nTSI_1)
                  setBarFgColor(Color.blue);
                  if(nTSI<nTSI_1)
                  setBarFgColor(Color.red);


                  with the following

                  if(aEMA5[0]>aEMA5[1])
                  setBarFgColor(Color.blue);
                  if(aEMA5[0]<aEMA5[1])
                  setBarFgColor(Color.red);


                  That will color the signal line based on its direction
                  Alex

                  Comment


                  • #10
                    Alexis It's a keeper

                    Alexis, Cool
                    It's a keeper!
                    thanks,
                    Jack

                    Comment


                    • #11
                      aEMA not defined??

                      Alexis,

                      Error message,

                      Aema is not defined??
                      help.

                      Comment


                      • #12
                        Jack
                        It should be aEMA5[x] where x is 0 for current bar, 1 for the prior bar, 2 for 2 bars ago. I am not sure what the length of that array is but I think it is set to 3 which means you can retrieve the aEMA5 values of up to two bars ago
                        Alex

                        Comment


                        • #13
                          Thanks Alexis .....nt

                          Thanks Alexis........nt

                          Comment

                          Working...
                          X