Not logged in
Viewing 4 posts - 1 through 4 (of 4 total)
  • #111538 |
    Participant
    9 Posts

    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
     
     
     
     

     

    Attachments in this forum are visible only for registered users.
    #122491
    Participant
    9 Posts

    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?

    Attachments in this forum are visible only for registered users.
    #122492
    Participant
    9 Posts

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

    #122524
    Mark Fric
    Administrator
    1182 Posts

    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

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.