molanis.com/forum - Tools for MetaTrader : The place to ask about the best expert advisor builder, expert advisor downloads, and expert advisor programming

AFTER YOU REGISTER SEND US AN EMAIL TO ACTIVATE YOUR ACCOUNT - Before posting:-1- Please read the user guide -2- Try the examples -3- Search in the forum
It is currently Thu May 16, 2024 8:39 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: EA executes before "crossover"
PostPosted: Thu Apr 25, 2013 4:16 am 
Offline

Joined: Wed Apr 03, 2013 9:47 pm
Posts: 5
Hi,

I built this simple EA which is supposed to trade after the stochastic "crossover" sometimes it trades before the "crossover" takes place, can someone please help????

Thanks.


Attachments:
25sto523buy100stop0.01lot.mol [8.48 KiB]
Downloaded 406 times
Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Thu Apr 25, 2013 10:44 am 
Offline
Site Admin

Joined: Fri Oct 16, 2009 3:40 pm
Posts: 451
Your ea seems fine. Make sure you use price field close/close when you attach the indicator as in the ea (setting it to 1 in the builder means close close)
I took your ea and modified to create an example. It works fine in my backtesting. Keep in mind that if you are not trading multi time frame, it is better to use current time frame so the ea will work in any time frame


Attachments:
File comment: Stochastic example
Stoch-EA.mol [11.8 KiB]
Downloaded 404 times
Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Thu Apr 25, 2013 8:52 pm 
Offline

Joined: Wed Apr 03, 2013 9:47 pm
Posts: 5
Hi,

Yes i the price field is correct, and i do trade over multiple time frames, my strategy is semi automated and enter only on the close of 4hr bars, It works fine with backtesting but when using it live it has entered before the crossover on numerous occasions, but then sometimes it works fine, it is very strange. I have to keep an eye on it all the time incase it enters early which obviously defeats the object of EAs. Next time it happens I will take some screen shots.

Thanks.


Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Thu May 02, 2013 10:23 am 
Offline

Joined: Wed Apr 03, 2013 9:47 pm
Posts: 5
Hi again,

Here We have another 'glitch', no buy position was taken after the crossover, screenshot and EA attached.

Thanks.


Attachments:
audn.PNG
audn.PNG [ 36.66 KiB | Viewed 6352 times ]
25sto523buy100stop0.05lot.mol [8.48 KiB]
Downloaded 386 times
Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Thu May 02, 2013 4:35 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
I think the strategy is fine. I do not see in the chart the error.
If you think all set up is fine then you need to look at the logs. It will show why the trade was not taken.
In mt4 go to the expert tabs and open the logs. It is a big file, try to locate the time of the trade.


Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Thu May 02, 2013 8:40 pm 
Offline

Joined: Wed Apr 03, 2013 9:47 pm
Posts: 5
Hi again.

Right...Here, these trades shouldn't have been made, the stochastic main line was below 75 when the crossover took place, one of the conditions is that stochastic main is above 75 at the close of the 4hr bar.

Thanks.


Attachments:
75sto523sell100stop0.03lot.mol [8.47 KiB]
Downloaded 399 times
cadjpy.PNG
cadjpy.PNG [ 37.28 KiB | Viewed 6338 times ]
sgdjpy.PNG
sgdjpy.PNG [ 35.96 KiB | Viewed 6334 times ]
Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Sat May 04, 2013 4:57 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
I think you chart set up is not correct. Check our chart, it shows the indicator using close-close and low-high. the set up in the ea uses close-close but your chart uses low-high. Change your chart settings


Attachments:
stcherror.png
stcherror.png [ 44.32 KiB | Viewed 6380 times ]
Top
 Profile  
 
 Post subject: Re: EA executes before "crossover"
PostPosted: Sun May 05, 2013 9:02 pm 
Offline

Joined: Wed Apr 03, 2013 9:47 pm
Posts: 5
Thats the one!!!!

Thanks very much.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by Molanis © 2009