Hello Everyone,
I have recently studied the ProBuilder Manual and found it very exciting and helpful. However, I tried to code something and it is giving me an error which I am unable to rectify.
Here is the code:
// Faster Average = 8
// Slower Average = 18
// Difference Period = 9
fastAvg = Average[8](close)
slowAvg = Average[18](close)
differencePeriod = 9
trendDifference = fastAvg - slowAvg
differenceAvg = Average(trendDifference, differencePeriod)
RETURN trendDifference AS "Trend Difference", differenceAvg AS "Difference Average"
The problem is with the differenceAvg line. I want to get the average of both trendDifference and differencePeriod but unable to do so.
Can anyone please guide me how to rectify this problem.
Thanks in advance.
I also have attached the image.
Regards,
Maisam
You cannot use AVERAGE as you have done. Simply do this:
differenceAvg = (trendDifference + differencePeriod) / 2
Another “code help” labelled topic. We should declare it as the only one valid name for topics, it would save me soooooo much time! :devil:
Thanks very much @Vonasi. Very quick reply. Really appreciate it.
@Nicolas – Really sorry about that. I will try to be more careful next time.
Regards,
Maisam
Another “code help” labelled topic.
Ooops….. was going to correct that but forgot to do it after I’d replied!