Trade manager EA

3 replies

jonnywolf

Subscriber, bbp_participant, community, 25 replies.

Visit profile

10 years ago #111538

I am trying to make a simple Trade manager EA. Basically which does the following.

 

If entering at market, then

the Stop loss is set to 1xATR (7)
the Take Profit is set to 2 x ATR (7)
the EA will close 50% position once price hits 1x ATR (7) in profit
and moved the stop loss to break even.

 

I have tried to make one but bit lost.

 

Pseudo Source Code of Strategy
 
 
 Generated by StrategyQuant EA Wizard version 1.4.1
 Generated at Sun Aug 11 14:52:00 BST 2013
====================================================================
 
//——————————————————————–
// Variables
MaxSlippage = 3;
 
 
//——————————————————————–
// Rule 1
if (((Market Position() is Long) Or (Market Position() is Short))) then
      Move Stop Loss to a given price for order with Magic Number: 1000;
end if;
 
//——————————————————————–
// Rule 2
if (((Market Position() is Long) Or (Market Position() is Short))) then
      Move Profit Target to a given price for order with Magic Number: 1000;
end if;
 
//——————————————————————–
// Rule 3
if (((Market Position() is Long) Or (Market Position() is Short))) then
      Partially Close order with Magic Number: 1001;
end if;
 
//——————————————————————–
// Rule 4
if ((OrderOpenedThisBar(( 1000 )) is True)) then
      Move Stop Loss to a given price for order with Magic Number: 1002;
end if;
 
Help much appreciated.
 
James
 
 
 
 

 

0

jonnywolf

Subscriber, bbp_participant, community, 25 replies.

Visit profile

10 years ago #122491

ok i have tried a few things but the strategy is not working on my live mt4. I know its probably a simple thing i am not doing. Any ideas?

0

jonnywolf

Subscriber, bbp_participant, community, 25 replies.

Visit profile

10 years ago #122492

I put 1000 in the comments field. But it does not seem to recognise that an order has been opened manually.

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #122524

Hello Jonny,

 

the problem is that EA Wizard uses magic numbers to recognize trades to manage.

When you enter trade manually there’s no way of specifying its magic number, such trade doesn’t have magic number.

 

So EA Wizard currently cannot manage trades created manually.

We’d have to add there possibility to to recognize trades by their comments instead of magic numbers.

 

Mark

Mark
StrategyQuant architect

0

Viewing 3 replies - 1 through 3 (of 3 total)