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 Tue Apr 30, 2024 2:47 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: EA with one or two trades
PostPosted: Sat Mar 14, 2015 4:03 pm 
Offline

Joined: Sat Jan 24, 2015 6:20 am
Posts: 14
Hi, I would like to create an EA with the following rules:
GBPUSD
Time frame 15 Minutes
Moving average 19 periods LWMA
Take profit 20 pips stop loss 20 pips

If the first operation is to target, I would like that the system did not do anything new.
If, instead, the first operation is to be at a loss, I would like him to do the next operation in the opposite direction.
Basically I would like to perform one operation per day if I have a profit or 2 if the first operation is to be at a loss.
If I insert in Trade Management "wait until an opposite trade is opened" the system still continues to carry out operations in the opposite direction.
But I would only make one transaction per day if in gain, otherwise perform the second and then stop the operation..
How can I fix this?
Thank You


Attachments:
Experiment.mol [6.83 KiB]
Downloaded 694 times
Top
 Profile  
 
 Post subject: Re: EA with one or two trades
PostPosted: Sun Mar 15, 2015 8:19 am 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
There been some post on how to get one trade per day
if the ea is at a loss do the next operation in the opposite direction is difficult to get. You will need to use the mql icons. Also how do you define a loss, what happens when there is a reversal. You need to think in all possible cases.


Top
 Profile  
 
 Post subject: Re: EA with one or two trades
PostPosted: Sun Mar 15, 2015 3:22 pm 
Offline

Joined: Sat Jan 24, 2015 6:20 am
Posts: 14
What advice would you give me the use of mql icons?


Top
 Profile  
 
 Post subject: Re: EA with one or two trades
PostPosted: Mon Mar 16, 2015 1:16 pm 
Offline

Joined: Tue Dec 22, 2009 12:22 am
Posts: 1761
Try to start with something simple like this viewtopic.php?f=3&t=361&p=11676#p11676
Once you know how to deal with open positions you may ant to check at the code to get the info you want. We are working to add some of this functions as icons for the next release but it is far away.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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