Replies

gabrielelimarilli
05 Jul 2023, 10:22

RE:

firemyst said:

One way to do it is you need to keep track of your engulfing candles. You might want to use something like two Dictionary<int,double>() objects (one for bull candles and one for bear candles) where the key is the "bar's index" and the value is the high/low of the price.

On every new bar:

1) check every value in the bullish dictionary

2) if current price > the price of an entry in the dictionary (each value), a) delete the indicator icon at the specified bar (the key value) and b) delete the key/value pair from the dictionary as you know you don't have to check it ever again.

3) repeat steps 1-2 above for the bearish dictionary

4) if the previous bar is a bullish engulfing candle add the bar's index as the "key" to the bullish dictionary with the high price as the "value"

5) if the previous bar is a bearish engulfing candle add the bar's index as the "key" to the bearish dictionary with the low price as the "value"

 

Hi, thank you so much for the answer, unfortunatly I'm a noob coder and I have no Idea how to do it, if you kindly can show me an example on how should be done in a pratical way I will be very thankfull to you :). Thanks again, have a nice day .

 

Just for curiosity, where did you learnt calgo so well?


@gabrielelimarilli