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

EA with one or two trades
http://www.molanis.com/forum/viewtopic.php?f=2&t=6133
Page 1 of 1

Author:  lmt13 [ Sat Mar 14, 2015 4:03 pm ]
Post subject:  EA with one or two trades

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 739 times

Author:  molanisfx [ Sun Mar 15, 2015 8:19 am ]
Post subject:  Re: EA with one or two trades

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.

Author:  lmt13 [ Sun Mar 15, 2015 3:22 pm ]
Post subject:  Re: EA with one or two trades

What advice would you give me the use of mql icons?

Author:  molanisfx [ Mon Mar 16, 2015 1:16 pm ]
Post subject:  Re: EA with one or two trades

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.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/