I am just starting learning Ninjascript and successfully code a few indicators. My next one is color coding my Stochastics indicator (%D to be specific) - if %D is rising I want to color it Green and if %D is falling I want to color the line Red.
If I didn't have the benefit of asking this Forum, my defacto would be a simple compare of 2 points, e.g., to check for rising %D[0] > %D[1] and vice versa for falling %D[0] < %D[1]. Thinkorswim has a simple check "if rising...." or "if falling" and you're done.
Is there a standard way of checking slope? Also I wanted my indicator to have more sophistication, e.g., how do tell if market is consolidating? I would paint a different color for that scenario, although this would be Part 2 of this activity.
If anyone has a snippet to help in this post, kindly paste here.
Thanks in advance!

Comment