Hi, I'm trying to code but have a question. I've made this simple EA based on reading indicators and seems to work but not totally the way I want and I'm sure it's something simple
What I have is my EA calling signals from two indicators (VQ and QQEA)and trade when they agree to buy or sell together. The problem is that I only want the EA to initiate a trade when they signal at the exact same time but what is happening is that it's trading anytime when they agree. You'll see by the pic the EA is trading as both indicators are in a downward direction every tick I only want it to trade when they first signal not every bar
Here is my code. hope it's a simple fix
What I have is my EA calling signals from two indicators (VQ and QQEA)and trade when they agree to buy or sell together. The problem is that I only want the EA to initiate a trade when they signal at the exact same time but what is happening is that it's trading anytime when they agree. You'll see by the pic the EA is trading as both indicators are in a downward direction every tick I only want it to trade when they first signal not every bar
Here is my code. hope it's a simple fix
Inserted Code
double VQ0 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0,0); double VQ1 = iCustom(NULL, 0, "VQ", false,0,5,3,1,5,true,false,true,true,false,true,1485, 0,1); double QQEA0 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 0); double QQEA1 = iCustom(NULL, 0, "QQEA",5,14,4.236, 0, 1);
Inserted Code
//Buy if (VQ0>VQ1 && QQEA0>QQEA1 && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount)))) { if(!IsTrade) {
24 hours in a day – 24 bottles of beer in a case – Coincidence? I think not