So such conditions simply do not exist (an error in the logic of signal construction)
//--- BUY Signal if(KV4Array[0] > 0.0) // uptrend confirmation if(KV1Array[0] > 0.0) if(KV1Array[1] < 0.0) // indicator closes above 0 { signal = "Buy"; } //--- SELL Signal if(KV4Array[0] < 0.0) // downtrend confirmation if(KV1Array[0] < 0.0) if(KV1Array[1] > 0.0) // indicator closes above 0 { signal = "Sell"; }
So such conditions simply do not exist (an error in the logic of signal construction)
thanks for your quick reply.
So instead of 0 I need to use 0.0 ? If not could u pls explain it ?
Thanks,
Nils
Hi Vladimir,
thanks for your quick reply.
So instead of 0 I need to use 0.0 ? If not could u pls explain it ?
Thanks,
Nils
You need to fix: indicator logic, signal search logic.
You need to fix: indicator logic, signal search logic.
Thanks,
Nils
Could u give me an example or a more specific advise? I read a lot articles, but Iam still new to this.
Thanks,
Nils
did you code this yourself?
did you try instead of 0 to use 0.0 ?
and it didnt work?
did you code this yourself?
did you try instead of 0 to use 0.0 ?
and it didnt work?
Yes I coded it by myself. I used 0.0 and still only Buy trades.
If there is an open order, it will not open a second order. If the first opened order is buy, it does not open the sell order.
If there is an open order, it will not open a second order. If the first opened order is buy, it does not open the sell order.
So it means, because the 1st Signal is a Buy Signal it only trades Buy Signals? I just deleted the Buy Signal condition, the EA should only tradesSell Signals, but no trades?!
The logic should be fine, because it triggers the Buy Signal condition and they look fine (Value based).
Do you have an idea where I need to fix my code? Vladimir said already that the " indicator logic, signal search logic" needs to be fixed, but I have no idea where.
So it means, because the 1st Signal is a Buy Signal it only trades Buy Signals? I just deleted the Buy Signal condition, the EA should only tradesSell Signals, but no trades?!
The logic should be fine, because it triggers the Buy Signal condition and they look fine (Value based).
Do you have an Idea where I need to fix my code? Vladimir said alread that the " indicator logic, signal search logic" needs to be fixed, but I have no idea where.
We only see the logic of opening orders here
maybe the problem is in the indicator you use
//We calculate the value for the current+1 candle double KV1Value1 = KV1Array[1]; //// double KV4Value1 = KV1Array[1]; //// two double equal to same parameters KV4Value1=KV4Array[1]???? //BUY Signal if (KV4Value0 > 0) //Uptrend confirmation if (KV1Value0 > 0) if (KV1Value1 < 0) //Indicator closes above 0 { signal = "Buy"; } //SELL Signal if (KV4Value0 < 0) //Downtrend confirmation if (KV1Value0 < 0) if (KV1Value1 > 0) //Indicator closes above 0 { signal = "Sell"; }
And the logic should be like this
as a sample
if(KV4Value0<0.0 && KV1Value0<0.0 || KV1Value1>0.0) { signal = "Sell"; }
We only see the logic of opening orders here
maybe the problem is in the indicator you use
And the logic should be like this
as a sample
I attahced the indicator. I hope its not to much to ask for, but could u maybe have a quick look at it?
During the visual backtest I found out the EA opens more trades then it should. Sometimes it only opens 1 trade and sometimes more, see below. Any idea how is that possible, if the EA checks the open positions before he opens a trade?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I coded a simple EA based on one indicator which uses inidcator values from the current chart and the H4 chart. During the Backtest it came to my intention, that the EA only opens Buy Orders. When I change the code to only Sell Signals, it doesnt open any Trades. Does someone have an idea why this EA only opens Buy Signals?Thanks in advance for your help!
Nils