SimpleEA - close above/below MA - problem

 

Hi to all,

I have a big appeal to you.

I build simple EA on EA builder.

This EA open long position when bar open below and close above SMA 21 close.

But no each time - when is complied conditions, is open trade (see attached pict).

Know any body why PLEAS??

lbs


PS: excuse my bad English pleas.

 
Files:
 
lbs:

Hi to all,

I have a big appeal to you.

I build simple EA on EA builder.

This EA open long position when bar open below and close above SMA 21 close.

But no each time - when is complied conditions, is open trade (see attached pict).

Can any body why PLEAS?? lbs


Hi lbs, I did a quick test and your EA seems to Buy/Sell according to the rules in the code.


I looked at your charts...and the only thing I can see that may answer your question is the following:


The rules as you state...and using the long trades for example -


Do a long trade when the bar opens below...and closes above SMA 21...


The trades points you marked with questions look like the PREVIOUS Sell trade closed above the SMA and the NEXT Buy trade could not start because it was ALREADY ABOVE the SMA.


It did not start below the SMA and cross the SMA as your rule requires...


The SMA was already crossed when the previous Sell trade closed...so it has to wait for the next trade crossing condition.


To see for yourself...Run your EA in the Strategy Tester at slow speed and watch your EA make the trades.


It looks like the EA is working fine...


Hope this helps,

Robert

 
cosmicbeing:

Ahoj liber, já jsem rychlý test a vaše EA Zdá se, že Koupit / prodat v souladu s pravidly v kódu.


Podíval jsem se na své grafy ... a jediné, co vidím, že může odpovědět na vaši otázku je následující:


Pravidla, jak si stát ... a pomocí dlouhé obchody například -


Do obchodu, když dlouhý bar otevře níže ... a zavře se nad SMA 21 ...


Obchody bodů označené otázky vypadají stejně jako předchozí Prodáváme obchod uzavřen nad SMA a NEXT Prodám obchodu nelze spustit, protože to byla již bylo uvedeno výše SMA.


Nešlo spustit pod SMA a přes SMA jako pravidlo vyžaduje, ...


SMA už překročil, když předchozí Prodáváme obchod uzavřen ... takže to musí počkat na další obchodní křižovatkou stavu.


Chcete-li vidět na vlastní oči ... Zorganizuj svůj EA ve strategii Tester při pomalé rychlosti a sledovat svůj EA dělat obchody.


Vypadá to, že EA je v pořádku ...


Doufám, že to pomůže,

Robert









Hi Robert,

many thanks for your reply.

Know you, how make so as not wait for the next trade crossing condition, when the SMA was already crossed when the previous Sell trade closed, pleas?

Thanks for your help.

Lubos

 
lbs:


Hi Robert,

many thanks for your reply.

Know you, how make so as not wait for the next trade crossing condition, when the SMA was already crossed when the previous Sell trade closed, pleas?

Thanks for your help.

Lubos

Hi Lubos,

If you remove the first condition (check for Past Bar before the MA crossing) and leave the second condition (crosses the MA)...

You now have a simple basic MA Crossing EA.


But if you do this...you lose whatever strategy that checking the Past Bar gave you.


Original Code:

if (Buy1_1 < Buy1_2 && Buy2_1 > Buy2_2) Order = SIGNAL_BUY;

if (Sell1_1 > Sell1_2 && Sell2_1 < Sell2_2) Order = SIGNAL_SELL;



Change To Code:

if (Buy2_1 > Buy2_2) Order = SIGNAL_BUY;

if (Sell2_1 < Sell2_2) Order = SIGNAL_SELL;



This will make all BUYS above the MA and all SELLS below the MA....a basic MA crossing EA.

You will still need some other strategy's or indicators to fine tune this EA...


Hope this helps and you are having fun learning...!

Robert

 

Hi Robert,

many thanks for you reply and help.

I'm really totally beginner, I cope make EA only on EA builder, or modifi current EA or indicators.

Thi is my new problem - I want modifi "EMA cross alert indicator" to "SMA slope change alert indicator".

But after my modification, indicator not waiting for bar end, and I have much alert on one bar how SMA jumping up and down.

Can you modifi this indicator to signal/alert just onetime - on new bar PLEAS?


Thanks and nice day!

Lubos

 
...here is original indic
 

I know it's hard to start without any special education BUT!!! I've found some extra help for those, who doesn't have any free time for tones of books and internet serfing...
http://www.annaforex. com
She shares her knowledge and experience.
 
drew1:
I know it's hard to start without any special education BUT!!! I've found some extra help for those, who doesn't have any free time for tones of books and internet serfing...
http://www.annaforex. com
She shares her knowledge and experience.


yes, she like to share all with us :-)

I’d like to offer you a Robot
COMPLETELY FREE OF CHARGE!

 
lbs:

Hi Robert,

many thanks for you reply and help.

I'm really totally beginner, I cope make EA only on EA builder, or modifi current EA or indicators.

Thi is my new problem - I want modifi "EMA cross alert indicator" to "SMA slope change alert indicator".

But after my modification, indicator not waiting for bar end, and I have much alert on one bar how SMA jumping up and down.

Can you modifi this indicator to signal/alert just onetime - on new bar PLEAS?


Thanks and nice day!

Lubos

Hi Lubos,

I'm just a novice coder also and I try to help others learn how to code themselves, so I do not do coding for others...just for myself.

In the meanwhile, you can find many examples already done of EMA and SMA alerts that will trigger only once on the same bar...

Search this forum and others like TSD for these examples...

Or someone with better coding skills than I have can help you change the one you have.

Good luck,

Robert

 

Hi folks,

many thaks to all for help.

--> drew1 and EADeveloper:

I try backetest Forex Swissbot from annaforex.com, but no trade execute - in journal is this messages " Cannot open file 'C:\Program Files\SIGTrader\experts\indicators\Gann2-1.ex4' on the EURUSD,Daily"

and I can't find this indicator on the web.

Have anybody any advice for me pleas?

Thanks.

lbs

Reason: