How to "code" EA with ranging candle id?
-
Hi all, I have a strategy that consist of 5 indicators but I have issues "coding" 3 of them to work properly because sometimes it aligns with 1st and 2nd indicators on candle id 1 but most of the times it ranges as far as candle id 5. Any help with be appreciated. thank you
image for example. the trade should take place on the crosshair.

-
@deltaaurum Then what do you exactly need? All those indicators to be true within the same 5 candles period but separatedly at different moments, maybe?
-
@deltaaurum What I would do is count 1 on a variable every time the colour appears, rest this to 0 on other colour and count, check this number when all other conditions are met.
-
@l-andorrà how do I create it to be like how it is suppose to place the trade in the image?
-
@jstap you mean I should put 1 for the 1st and 2nd indicator and 0 on the remaining 3?
-
@l-andorrà @jstap this is another project and should also place trade at the crosshair with macd crossing earlier before the other 2 conditions are met. ema and psar can be on candle id 1 but how should i make it for macd because it can also range and cross earlier by a few candles

-
@deltaaurum There are various ways but try this, when macd meets your condition set a variable to 0, once per bar add 1, when condition is opposite set another variable to 0 and count every bar. Set this up on a small project and visually back test, with the variables in a comment so you can see what happens. Once this is working add flags to start/stop the count.
-
@jstap I dont understand what you mean as I am still new to fxdreema
been using it for a few days only. could you help me out and make an example please? here's the link to my project (https://fxdreema.com/shared/JjiPEfrtc) -
@deltaaurum Something like thisw: https://fxdreema.com/shared/PTOOQldU
-
@jstap ah I see but how would I do it for a Macd with 2 lines crossing? this is the indicator macd 2line
-
@deltaaurum That is the logic of how to do 1 condition, to do more conditions add other trees, and you can add more conditions to a tree to have more conditions working together.
-
@jstap where do I add the amount of candle id for this?
-
@deltaaurum In condition ], more settings, you can select ID, this though is limited to a single candle.
-
@jstap but it won't work for ranging candle id right?
-
@deltaaurum You need to add more logic, so when a condition happens, you record the time in a variable, you can delete or refresh when this happens again, this way you always know where the candle is.
-
@jstap how would I set 3rd,4th, and 5th condition/indicator to work on a ranging candle id since the conditions are met when at a certain candle id? like this project for example https://fxdreema.com/shared/OeCqwHpBc
-
@DeltaAurum Not too sure what you mean, generally in separate trees you need to save the candle when something happens.