EA entry conditions - error in code

To add comments, please log in or register
Mccallum28
354
Mccallum28  

Hi all,

I have the attached EA that I have put together but it is not workinmg exactly as I want it to and I cant see my errors.

Once all conditions are met it should enter a trade, if perceptron signals short and indicators signal short and Awesome is on a red bar then only then should there be a short entry.

as you can see by the picture attached there was a buy entry when the awesome bar was red, this should only have allowed a short entry.

Also it only seems to take long orders with no shorts?

Where have i gone wrong?

Files:
Mladen Rakic
153834
Mladen Rakic  
rg83:
Hi all,

I have the attached EA that I have put together but it is not workinmg exactly as I want it to and I cant see my errors.

Once all conditions are met it should enter a trade, if perceptron signals short and indicators signal short and Awesome is on a red bar then only then should there be a short entry.

as you can see by the picture attached there was a buy entry when the awesome bar was red, this should only have allowed a short entry.

Also it only seems to take long orders with no shorts?

Where have i gone wrong?

rg83

You are using opened bars for signals. In those cases it can happen : in one moment it is green, your ea opens a position and then it reverts to red. Use closed bars for signals instead and you will avoid those false signals

Mccallum28
354
Mccallum28  

Hi Mladen,

How would I change to closed bars, also have I made a mistake as I can only get it to open long trades, no shorts?

Thanks,

Mladen Rakic
153834
Mladen Rakic  
rg83:
Hi Mladen,

How would I change to closed bars, also have I made a mistake as I can only get it to open long trades, no shorts?

Thanks,

Change the shift (index) from 0 to 1

Mccallum28
354
Mccallum28  

Thanks Mladen,

Great advice and assistance as always.

Will this solve the uissue of only opening long positions as I want to trade both short and long.

Mladen Rakic
153834
Mladen Rakic  
rg83:
Thanks Mladen,

Great advice and assistance as always.

Will this solve the uissue of only opening long positions as I want to trade both short and long.

It will not solve the issue of opening only long orders

That is probably caused by some error in logical conditions. You have to check the conditions form opening short positions

Mccallum28
354
Mccallum28  

Thats the thing, I have looked through the conditions and they all seem to be correct.

Mladen Rakic
153834
Mladen Rakic  
rg83:
Thats the thing, I have looked through the conditions and they all seem to be correct.

Just some observations : macd long is not an inverse of macd short and "|" in ma long is not meaning or but bitwise or - change it to "||"

To add comments, please log in or register