Download MetaTrader 5

Second Entries

To add comments, please log in or register
Mtype
12
Mtype  

Hello friends,

I decided to learn coding so that I can create an indicator that would give me the following: A market condition where a candle breaks higher from the previous one for the second time.


Second Break Higher

The logic is illustrated in the above picture.

First condition is swing high found with iHighest function, then High[0] is > High[1], then the code would need to look for a break lower, where Low[0] < Low[1], then the Second Break Higher. I'm quite a beginner in programming but I'm doing my best. Any help would be appreciated in the logic or in the code that would help me create this.

Thanks.

Petr Nosek
367
Petr Nosek  
Mtype:

Hello friends,

I decided to learn coding so that I can create an indicator that would give me the following: A market condition where a candle breaks higher from the previous one for the second time.


The logic is illustrated in the above picture.

First condition is swing high found with iHighest function, then High[0] is > High[1], then the code would need to look for a break lower, where Low[0] < Low[1], then the Second Break Higher. I'm quite a beginner in programming but I'm doing my best. Any help would be appreciated in the logic or in the code that would help me create this.

Thanks.

  1. You should define the Swing High correctly and its validity. iHighest() won't be enough. 
  2. You have to find the first Break High within the Swing High's validity.
  3. You need to confirm continuation of counting (Break High) by Break Low.
  4. If the second Break High appears you should plot an indicator arrow
Mtype
12
Mtype  
Petr Nosek:
  1. You should define the Swing High correctly and its validity. iHighest() won't be enough. 
  2. You have to find the first Break High within the Swing High's validity.
  3. You need to confirm continuation of counting (Break High) by Break Low.
  4. If the second Break High appears you should plot an indicator arrow

Thank you Petr! 

Ian Tavener
1345
Ian Tavener  
ZigZag indicator repaints, but I like it for looking back and identifying previous swing highs and lows
Mtype
12
Mtype  
Ian Tavener:
ZigZag indicator repaints, but I like it for looking back and identifying previous swing highs and lows

Thanks Ian for the help

To add comments, please log in or register