Results 1 to 3 of 3
 2 Attachment(s)    

Thread: Stopping/Disabling the EA

  1. #1

    Question Stopping/Disabling the EA

    Hi! I would like to know how I can let the ea doesn't trade(stop/disable) after I press the F12 key, the F12 function is working good, but even after I press it, the ea still opening new orders. The "EA" is attaching, thanks in advance for any help!
    Attached Files Attached Files

  2. #2

    Default

    if you really want the EA disabled after the F12 key is pressed, you could do this:
    Code:
    //Closing All Position
       if(GetAsyncKeyState(VK_F12))
       {
          NewOrders=false;
          MaxTotalOrders=-1;
          Alert ("The 'F12' key have been pressed. Closing trade basket now");
          CloseBasketTrades();
       }      
       if(!NewOrders) return(0);
    You could move the "if(!NewOrders)" statement anywhere in the code if you needed some of the lines to run. The only way to get it started again is with a reset.

    Paul

  3. #3

    Thumbs up

    Quote Originally Posted by ppentz View Post
    if you really want the EA disabled after the F12 key is pressed, you could do this:
    Code:
    //Closing All Position
       if(GetAsyncKeyState(VK_F12))
       {
          NewOrders=false;
          MaxTotalOrders=-1;
          Alert ("The 'F12' key have been pressed. Closing trade basket now");
          CloseBasketTrades();
       }      
       if(!NewOrders) return(0);
    You could move the "if(!NewOrders)" statement anywhere in the code if you needed some of the lines to run. The only way to get it started again is with a reset.

    Paul
    Thanks, but it doesn't work, I would like to disable* the ea after I press the F12, do you know how I can do it?

    *Like I was pressing the Expert enable/disable button - pic is attached
    Attached Images Attached Images Stopping/Disabling the EA-button-jpg 
    Last edited by szmvscla; 07-15-2009 at 02:58.

Similar Threads

  1. Stopping the EA if the daily profit/loss reached
    By szmvscla in forum Ideas for expert advisors
    Replies: 0
    Last Post: 06-07-2009, 10:00

Tags for this Thread

closing, color, expert, stop

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •