Reply

X number of closes above/below SMA optimize

2 replies

Threshold

Customer, bbp_participant, community, 723 replies.

Visit profile

7 years ago #115340

I am making an EA that looks for X number of consecutive closes above/below an SMA.

The only way I know how to do this is:
close [step1]> sma[step1]
close [step2]> sma[step2]
close [step3]> sma[step3]
close [step4]> sma[step4]
close [step5]> sma[step5]

etc…. but this is not optimizable. Is there another way of doing this so I can optimize X number of consecutive closes above/below the SMA?
 

0

tomas262

Administrator, sq-ultimate, 2 replies.

Visit profile

7 years ago #138284

Hello,

 

yes, it can be done by using counter. See the example attached

0

Threshold

Customer, bbp_participant, community, 723 replies.

Visit profile

7 years ago #138286

Nice, this opens a lot of options up for me. Can see this being used in so many ways.

Thanks Tomas.

0

Viewing 2 replies - 1 through 2 (of 2 total)