Not logged in
Viewing 7 posts - 1 through 7 (of 7 total)
  • #231029 |
    Conmariin
    Customer
    116 Posts

    Hi! :)

    Is it possible to build an half automatic EA? I mean opening the trade immediately or by stop-order manually. But the rest like SL, TS and so on will be managed by the EA after opening.

    I tried, see attachment, but after I opened a trade manually it opens another but without adding SL and so on.

    SL is 2*ATR(14) and TP is double 2*ATR(14). After reaching the TP it should close Trade partially.

    Can anyone help me out?

    Thanks! :)

     

    Attachments:
    You must be logged in to view attached files.

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

    #231039
    tomas262
    Administrator
    1827 Posts

    Hello,

    here is an example on a semi-auto trading system on our blog https://strategyquant.com/article/simple-support-resistance-trading-system-tutorial-for-ea-wizard

    Why don’t you set the SL with the buy/sell order? You can start with a big value and modify as trade develops

    #231050
    Conmariin
    Customer
    116 Posts

    Thanks for your answer, but I think that’s not directly what I want. In this S/R example the order is opened when price hits Support or Ressistance. But what I want is: User is opening an order manually (buy or sell). He’s allowed only open one per direction per chart/symbol.

    The semiautomatic EA activates by “seeing” an order is opened an overtake control. (Adding SL, PT, TS, etc.) and in my case after reaching the PT Goal close order partially. Is that possible?

    Thanks! :)

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

    #231069
    tomas262
    Administrator
    1827 Posts

    Hello,

    this cannot be done in EA Wizard directly. You would need to use additional MQL4 code to manage SL, PT, TS. I can try to create a function that places SL & PT for manually placed trades

    #231073
    Conmariin
    Customer
    116 Posts

    Hi Tomas,

    ah okay. I understand. That would be nice. :)

    Thank you! :)

     

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

    #232710
    tomas262
    Administrator
    1827 Posts

    Hello

    I have attached an example on how to use EA to add SL + PT to a manual order. Once a long order is opened without SL & PT EA automatically add SL + PT of predefined size. See the file attached.

    Also custom code must be added to CustomFunctions.mq4

    void setSLPT(int orderMagicNumber, int slpips, int ptpips) {

    for(int op=0; op<OrdersTotal();op++) {
    if(OrderSelect(op,SELECT_BY_POS,MODE_TRADES)==true && OrderMagicNumber()==orderMagicNumber) {
    double slprice = NormalizeDouble(OrderOpenPrice()-10*Point*slpips,Digits);
    double ptprice = NormalizeDouble(OrderOpenPrice()+10*Point*ptpips,Digits);
    OrderModify(OrderTicket(),OrderOpenPrice(),slprice,ptprice,0,Blue);
    }
    }
    }

    Attachments:
    You must be logged in to view attached files.
    #232716
    Conmariin
    Customer
    116 Posts

    Thank you so much Tomas! :)

    That will help me enormously!

    Automatisches Handeln mit Expert Advisor
    https://www.rabenesche.de

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

You must be logged in to reply to this topic.