I am a beginner to coding and I am trying to learn how to write a number of conditions that could help me in my strategy development, so apologies in advance if what I am asking might sound strange. I am currently having problem writing a code with the following logic:
(Count the Number of Bars which have the close below an indicator) / Current numbers of bars in progress.
If the result is > than X ,
then set Bool to be true.
For example.
If current number of bars with close < 20EMA = 20
Current number of bars in progress since beginning of session = 30
do
20/30 = 0.66
if 0.66 > Threeshold
then set Bool to be true.
I hope it makes sense what I am asking and I thanks everyone in advance for the help


Comment