This code doesn't work fine, what is wrong in this code?
Doesn't work is meaningless. What results do you have ?
Hi Alain,
Je suis français.

Find below the open trades of my EA, why some of trades are not take?
Personne n'est parfait.
Tu m'étonnes... d'autant plus qu'on à Hollande comme président.... et qu'il veut se représenter aux prochaines présidentielles... on en peut plus... vous ne vous le voulez pas en Belgique ? Vous avez déjà Gérard Depardieu, Arthur, Daniel Auteuil, José Garcia, la famille Meunier, (propriétaire de Carrefour), la famille Mulliez (propriétaire d’Auchan), ainsi que Bernard Darty (fondateur des magasins Darty), etc... vous pouvez aussi prendre Hollande, svp :)
If the code posted above seems ok for you, it mean that there is a mistake into my EA code.
double sma_1 = iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,1); double sma_2 = iMA(NULL,0,MovingPeriod,MovingShift,MODE_SMA,PRICE_CLOSE,2); int GetSignalSell = 0, GetSignalBuy= 0; if(Close[2]>sma_2 && Close[1]<sma_1){GetSignalSell = 1;} if(Close[2]<sma_2 && Close[1]>sma_1){GetSignalBuy = 1;} if(GetSignalSell==1) { // sell } if(GetSignalBuy==1) { //buy }

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I try to code an EA.
Buy signal: bar n-2 close below my SMA + bar n-1 close above SMA => Open BUY
Sell signal: bar n-2 close above my SMA + bar n-1 close below SMA => Open SELL
Please find below a picture of the signal.
My code is:
This code doesn't work fine, what is wrong in this code?
Thank you for your help.
Bruno