Announcement

Collapse
No announcement yet.

Modify Stochastics Color

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

  • Modify Stochastics Color

    I was wondering if anyone would know how to modify a stochastics indicator. What I'm looking for is that when the slow stochastics is in the oversold or overbought zones (75 and 25, respectively), I would like the %D that is in those zones to change color, I would prefer that it doesnt change the entire line, but that's not a big problem. I looked everywhere on the boards, but couldn't find anything. If anyone has any suggestions they will be much appreciated.

    Thanks in advance,
    Nick
    " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
    -Jesse Livermore

  • #2
    Nick
    To do that you would use setBarFgColor() and use the [series] parameter to assign the color to the appropriate element of the return statement.
    If for example %D is the second element of the return array you would set your conditions and then color the plot using setBarFgColor(Color.yourcolor,1)
    Alex

    Comment


    • #3
      Alex,
      thanks for the response. But that just changed the entire line. I would like it just change the part of the line that is in the oversold/overbought zones. Example-green stochastics line. once it enters into an oversold condition, the part of stochastics is yellow, and once it leaves teh oversold condition, returns to green. Not exactly clear, but if anyone has any suggestions or questions i would appreciate it.


      Thanks,
      Nick
      " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
      -Jesse Livermore

      Comment


      • #4
        Nick
        The command I indicated will color the line only when the indicator is above/below the threshold defined in your conditions
        Alex

        Comment


        • #5
          Alex,
          sorry, I cant seem to figure it out. Whenver I put that command in, it changes the whole entire line. I'mo not exactly sure where to put that command in the attached efs. Any help with this is much appreciated.


          -Nick
          Attached Files
          " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
          -Jesse Livermore

          Comment


          • #6
            Nick
            Post the efs as you have modified it so that I can help you fix it
            Alex

            Comment


            • #7
              Alex,
              The stochastics i modified is in my last post. I'm just using the supplied EFS2 custom since I use the setting from a 5 minute chart to a later time frame. I just changed the color to green and got rid of the %D. Is there some other efs that would work better for what I need?

              Thanks
              Nick
              " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
              -Jesse Livermore

              Comment


              • #8
                Nick
                In that efs you have only modified the default color. You now need to apply your conditions that will define when the Stochastic is above/below a certain value and will color the plot.
                For an example of how to do this see the RSIPriceBars.efs in the PriceBars folder. In your case in place of vValue you will use xStochK.getValue(0) to retrieve the current value of the Stochastic
                Alex

                Comment


                • #9
                  Alex,
                  Ok, I looked at the RSI price bars efs and got the idea of what needs to be done. I added what I thought would work at the end of the attached efs, but nothing comes up. I dont get any syntax errors, but I dont get the stochastic line either. All i get is the two lines to show oversold and overbought.

                  any ideas??

                  thanks
                  Nick
                  Attached Files
                  " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
                  -Jesse Livermore

                  Comment


                  • #10
                    Nick
                    In your conditions replace xStochk with xStochK.getValue(0). In the return statement instead replace xStochK with getSeries(xStochK) as it was originally.
                    Alex

                    Comment


                    • #11
                      Alex,
                      I made those changes, but still do not get anything. Am I just missing something simple here? I appreciate all your help!

                      Thanks
                      -Nick
                      Attached Files
                      " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
                      -Jesse Livermore

                      Comment


                      • #12
                        Nick
                        In the script you just posted the conditions are still using xStochK. Once you implement the modifications I indicated in my prior reply the efs will work properly
                        Alex

                        Comment


                        • #13
                          Alex,
                          Thanks for all your help! Got it to work exactly how I wanted. I think the rest of the people on these boards appreciate all your help as much as I do.


                          Thank you,
                          -Nick

                          ps. i enclose the efs in case anyone else would like to use it.
                          Attached Files
                          " If a man didn't make mistakes he'd own the world in a month. But if he didn't profit from his mistakes, he wouldn't own a blessed thing."
                          -Jesse Livermore

                          Comment

                          Working...
                          X