♥ 0 |
Hello, I am just a self-taught scripter here and i am wondering if you can help me finish my chart study script about a condition counter, I am kinda stuck on the last part where i have to use a reccursive command with condition counter? I tried to find examples from the search results here and i cant seem to figure it out. Anyway, I have attached a picture to help me with my question. Basically, I am trying to plot scan a 2nd green dot after a red dot only. Then resets and plot the next 2nd green dot again after the red dot and so on. Here’s the script I have so far. declare lower; input length = 14; input price = close; input averageType = AverageType.WILDERS; def NetChgAvg = MovingAverage(averageType, price – price[1], length); def TotChgAvg = MovingAverage(averageType, AbsValue(price – price[1]), length); def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0; def RSI = 50 * (ChgRatio + 1); rec highpeak = if (RSI <= RSI [1] and RSI [1] >= RSI [2]) then RSI [1] else highpeak [1]; rec lowpeak = if (RSI >= RSI [1] and RSI [1] <= RSI [2]) then RSI [1] else lowpeak [1]; #———————— def greendot = ; #—————————– def reddot = ; rec counter = plot count = counter == 2;
Marked as spam
|
Please log in to post questions.