View Single Post
  #1  
Old 25-04-2019, 18:15
andypenez andypenez is offline
Level 1 Lasers Member
 
Join Date: Apr 2019
Posts: 1
Default Count Bars from indicator

Hi, have the following problem, I would like to use a trend indicator in my strategy (see Att_1).
In my test EA (see Att_2) is an example for OpenBuyOrder with MACD and for CloseLongPositions with ForexTrend_v2, currently only with value = 1.

How can I now determine that CloseLongPositions is only executed if the trend bars are at red for five periods or bars (see bottom snapshot), if they are less than five then nothing should be done!

Have tried everything possible with operands FOR, PeriodSeconds () .. unfortunately without success.

Thank you in advance for your help!
Attached Thumbnails
Count Bars from indicator-snap.jpg  
Attached Files
File Type: mq4 ATT_1 - ForexTrend_v2.mq4 (2.9 KB)
File Type: mq4 ATT_2 - Test_EA.mq4 (7.9 KB)
Reply With Quote