Need Help with Indicator Cross Over Signal
-
Hi All
I have developed an EA that triggers orders based on an indicator cross over however I would like to add a confirmation condition where it only triggers the order if the indicator line is still above/below the selected indicator level after the next two candles. I have tried the AND commands but cant get it to work correctly.
thanks
-
just put that 2nd condition before the first one. But we cant help unless we know what were looking at
-
Thanks for the response, I have included an image of the EA.

-
- Use a separate no trade for buys and sells
- remove OR
- Put that condition that you want to put in place of where the OR is currently. Don't make that one a cross as well, it will present you with more tradeable scenarios
-
Thanks, really appreciate your help, I will give it a try
-
Hello again. I am still struggling to get this to work. I tried putting the condition that the indicator needs to attain a certain value but will only open a trade if the indicator once attaining this value then crosses back over a another value, ie indicator needs to reach 300 then cross back over 100 before entering a trade. It doesn't open any trades when I test this version. Do you have any further advice on what I am doing wrong? To me it seems like its linking the condition criteria as and "AND" rather than a "THEN" and therefore not working.

-
-
@shutchin Share link here so that other can help to check for you..
-
-
@shutchin I have checked, I don't know what do you want but i have change as below picture it work.
(
-
Hi
Thank for the response however that doesn't work fro me. All I need is for the program to open a trade if the indicator reaches -150 and then crosses over -100. it seems a common thing people would want to do but I cant get it to work. So trigger one condition then if the second condition is triggered open the position.
-
never use the words Buy or Sell in your naming schemes. Its just good practice.
Also, never name anything the same name.
As for the rest...

Your logic is illogical.
The orange tab at the top is every tick. So every single time an order is placed across the broker, your EA is looking for all of these conditions in order at one time basically.
Logically you are saying, if no trades, true, go to next block.
CCI is below or equal to -100, if true
CCI cross above -100, if true
buy now.Is that what you are trying to logically search for every tick? If so, how do you expect CCI to be below -100 and be true , then then a fraction of a second later cross over -100?
What seems to be common isn't so common when you try to logically write it out.
I would suggest an exercise like the peanut butter and jelly exercise. Give someone a knife, a jar of jelly, and peanut butter and 2 slices of bread. Now instruct them to make a sandwich but they must follow your very specific rules and can not assume anything...only what you tell them to do.
-
What I am trying to achieve is to activate a buy when the following conditions are met:
- CCI value goes to -150 or less and then if this occurs
- CCI crosses from below to above -100 activate a buy order
-
@shutchin Your senod condition is the one triggering the order, so that should be searched for in the first place, then the CCI below -150 should confirm it. I would change its position in your block trees.
-
Hi
I tried to swap the order but it doesnt trigger any positions to open. I think the problem is that its treating the two conditions as "AND" now since they will not occur at the same time it will not work. What I need to tell it to do is if 1st condition met "THEN" if second condition met open trade
-
Hi, so if I dont use ontick what would I use?
-
Also to explain what I need more clearly I am not saying to trigger when indicator below -150 and crossing -100 at the same time, that is obviously not logical. The indicator needs to pass below -150 before then at some stage in the future cross over the -100 level at which point the position is opened.
-
@shutchin you need 2 conditions 1 above set to for example candle 1/2/3 ( whatever number you think) below -150, 2 below candle 0 above -100, you can have x, or <>, depends on what fits your position best.
-
thanks, seems to be at least opening trades now following your advice, just need to play with the candle numbers to optimize. Appreciate your help
-
@shutchin Your welcome.
