Help - Expiration Date on MQL EA
Results 1 to 2 of 2

Thread: Help - Expiration Date on MQL EA

  1. #1
    Hello men,

    Would you understand how to set expiration date on a pending order in an EA.

    OrderSend(Symbol(),OP_SELLLIMIT,1,xxxx,1,xxxx 20*Point,xxxx-20*Point,NULL,0,(This is the place where the expiration date supposed to be),CLR_NONE);

    The issue is that I don't really understand how to put the datetime variable here.

    The instance is that all order within my EA is opened at 8:00 (pending order), and that I want the order to be expired if it's not executed by 12:00. How do I set the expiration date?

  2. #2
    Https://forexintuitive.com/forex-tra...e-journal.html

    There is more than 1 means to do this. This is the way I did it.

    Currently for 2 hours:

    int et = TimeCurrent() (240*60)*60;

    OrderSend(Symbol(),OP_BUYSTOP,0.10,0,3,0,0,0,0,et, Green);

    Note: expiration period is set in moments; hence the necessity to multiply 240*60 and by 60 to get 4Hrs worth of moments.

    I have not checked this example, but it should function [quote]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners more information