Sign Up

Have an account? Sign In Now

Sign In

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

First independent community of traders

First independent community of traders Logo First independent community of traders Logo

First independent community of traders Navigation

  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • Buy Theme
  • Home
  • About Us
  • Blog
  • Contact Us
Home/ Questions/Q 4189
Next
In Process
imelam
imelam

imelam

  • 1 Question
  • 4 Answers
  • 0 Best Answers
  • 26 Points
View Profile
  • 0
imelam
Asked: December 27, 20202020-12-27T05:00:48+00:00 2020-12-27T05:00:48+00:00In: Forex Expert Advisors

The utility for enabling and disabling the “Automatic trading” button is needed

  • 0

Hello everybody! Please advise the utility (expert Advisor or something else 🙂 to enable or disable the “Automatic trading” button in MT4 on a schedule ( by the hour within the day) with the ability to set this-the schedule itself, of course. The point is that not every expert Advisor has such a function ( work on a schedule), and I want to turn on the adviser exactly when it is necessary. Already “steamed up” to look in the Internet, something I can not find anything. Maybe, who knows… Thanks ! 

  • 14 14 Answers
  • 0 Followers
  • 0
Answer
Share
  • Facebook

    14 Answers

    • Voted
    • Oldest
    • Recent
    1. egran

      egran

      • 0 Questions
      • 2 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      egran
      2020-12-27T05:02:26+00:00Added an answer on December 27, 2020 at 5:02 am

      For, myself, Yes. Thank you for your answers. I will delve into it!

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    2. vdev

      vdev

      • 1 Question
      • 42 Answers
      • 0 Best Answers
      • 100 Points
      View Profile
      vdev
      2020-12-27T05:02:21+00:00Added an answer on December 27, 2020 at 5:02 am

      Alexey Viktorov:

      Metaeditor is a text editor that can compile code into an executable file. (unlike Notepad). You can open an existing code or write a new one in it, and the format will be automatic. mq4 or mq5, depending on the terminal and your desire.

      The instruction can be opened in the Metaeditor itself 

      If you download AutoIt for yourself, and not in the Market, it’s easy to click on anything on the screen.

      if(CheckForNewOrder(Symbol(), cmd))
          {
              if(cmd == 0)
                  AU3_MouseClick("LEFT", CallX, CallY);
              else
                  AU3_MouseClick("LEFT", PutX, PutY);        
          }

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    3. alexeyvik

      alexeyvik

      • 1 Question
      • 74 Answers
      • 0 Best Answers
      • 172 Points
      View Profile
      alexeyvik
      2020-12-27T05:02:14+00:00Added an answer on December 27, 2020 at 5:02 am
      The utility for enabling and disabling the “Automatic trading” button is needed

      Egran:

      Eugene, do I understand correctly that the code should be placed in a file in Metaeditor and saved as an expert Advisor?

      Only in what format to create a file?  I tried everything, nothing works )) 

      Is there a place to read the instructions?

      Metaeditor is a text editor that can compile code into an executable file. (unlike Notepad). You can open an existing code or write a new one in it, and the format will be automatic. mq4 or mq5, depending on the terminal and your desire.

      The instruction can be opened in the Metaeditor itself 

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    4. egran

      egran

      • 0 Questions
      • 2 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      egran
      2020-12-27T05:02:06+00:00Added an answer on December 27, 2020 at 5:02 am
      The utility for enabling and disabling the “Automatic trading” button is needed

      Evgeny Belyaev:

      This is the adviser. You don’t need to turn anything.

      Eugene, do I understand correctly that the code should be placed in a file in Metaeditor and saved as an expert Advisor?

      Only in what format to create a file?  I tried everything, nothing works )) 

      Is there a place to read the instructions?

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    5. genino

      genino

      • 1 Question
      • 20 Answers
      • 0 Best Answers
      • 60 Points
      View Profile
      genino
      2020-12-27T05:01:59+00:00Added an answer on December 27, 2020 at 5:01 am

      ssv-11:

      How to turn it into an expert Advisor?

      This is the adviser. You don’t need to turn anything.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    6. ssv-11

      ssv-11

      • 0 Questions
      • 1 Answer
      • 0 Best Answers
      • 22 Points
      View Profile
      ssv-11
      2020-12-27T05:01:51+00:00Added an answer on December 27, 2020 at 5:01 am

      How do I make this code work?

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    7. nuolin

      nuolin

      • 0 Questions
      • 2 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      nuolin
      2020-12-27T05:01:44+00:00Added an answer on December 27, 2020 at 5:01 am

      Andrew Kornishkin:

      Thanks for the answer. Just sorry for the lack of enlightenment, maybe this branch is for initiates and I, being not from that caste, did not get there, but I do not understand programming, I can only use advisors. I, as an option, found a semi-automatic solution: I created my own MT4 profile for each day of the week, in which the necessary trading hours are enabled for each tab of the trading instrument, and the unnecessary ones are disabled. It remains only at the junction of the day to manually switch to the profile corresponding to the coming day of the week. And, as an option to fully automate this process, if possible, an expert Advisor for automatically switching to a given profile on a given day of the week and at a given time would help.

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    8. am2

      am2

      • 0 Questions
      • 1 Answer
      • 0 Best Answers
      • 22 Points
      View Profile
      am2
      2020-12-27T05:01:39+00:00Added an answer on December 27, 2020 at 5:01 am

      Today just asked to do the same almost plus the closure of all positions:#define VK_CONTROL 0x11 //CTRL key
      #define KEY_CODE   'E'

      #import "user32.dll"
      void  keybd_event(int bVk,int bScan,int dwFlags,int dwExtraInfo);
      #import

      #include

      //Object of the CTrade class
      CTrade trade;

      / / Object of the CPositionInfo class
      CPositionInfo position;

      input int StartHour = 9;
      input int StopHour  = 23;
      //+------------------------------------------------------------------+
      //| Expert initialization function                                   |
      //+------------------------------------------------------------------+
      int OnInit()
        {
      //---

      //---
         return(INIT_SUCCEEDED);
        }
      //+------------------------------------------------------------------+
      //| Expert deinitialization function                                 |
      //+------------------------------------------------------------------+
      void OnDeinit(const int reason)
        {
      //---

        }
      //+------------------------------------------------------------------+
      //|                                                                  |
      //+------------------------------------------------------------------+
      void Key()
        {
         keybd_event(VK_CONTROL,0,0,0);
         Sleep(10);
         keybd_event(KEY_CODE,0,0,0);
         Sleep(10);
         keybd_event(KEY_CODE,0,2,0);
         Sleep(10);
         keybd_event(VK_CONTROL,0,2,0);
        }
      //+------------------------------------------------------------------+
      //|                                                                  |
      //+------------------------------------------------------------------+
      bool TimeSession(int aStartHour,int aStartMinute,int aStopHour,int aStopMinute,datetime aTimeCur)
        {
      / / - - - session start time
      int StartTime=3600*aStartHour+60*aStartMinute;
      / / - - - session end time
      int StopTime=3600*aStopHour+60*aStopMinute;
      / / - - - current time in seconds from the beginning of the day
         aTimeCur=aTimeCur%86400;
         if(StopTime// - - - going through midnight
            if(aTimeCur>=StartTime || aTimeCurreturn(true);
              }
           }
         else
           {
            / / - - - within one day
            if(aTimeCur>=StartTime && aTimeCurreturn(true);
              }
           }
         return(false);
        }
      //+------------------------------------------------------------------+
      //| Expert tick function                                             |
      //+------------------------------------------------------------------+
      void OnTick()
        {
      / / closing by time
      if(!TimeSession(StartHour,0,StopHour,0,TimeCurrent()))
           {
            for(int i=0; i<PositionsTotal(); i++)
              {
               if(position.Select(PositionGetSymbol(i)))
                 {
                  / / close an open position for this symbol
                  trade.PositionClose(PositionGetSymbol(i));
                 }
              }
           }

      / / enabling by time
      if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)==0 & & TimeSession(StartHour,0, StopHour,0,TimeCurrent())) Key();
      / / disable by time
      if(TerminalInfoInteger(TERMINAL_TRADE_ALLOWED)==1 && !TimeSession(StartHour,0,StopHour,0,TimeCurrent())) Key();

         Comment("
      Enable: "
      ,TerminalInfoInteger(TERMINAL_TRADE_ALLOWED),
                 "
      Time: "
      ,TimeCurrent());
        }
      //+------------------------------------------------------------------+

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    9. vdev

      vdev

      • 1 Question
      • 42 Answers
      • 0 Best Answers
      • 100 Points
      View Profile
      vdev
      2020-12-27T05:01:27+00:00Added an answer on December 27, 2020 at 5:01 am

      Alexandr Saprykin:
      yeah…Advisor for managing advisors… so soon they will start looking for an Advisor to manage advisors by managing advisors…ugh..

      I remembered)

      1. People who lead round dances are called round dancers
      2. People who study choirboys are called choirboys
      3. People who study horofumoxovebab, call horofumoxovebab
      4. ..
      5. ..
      6. ..
      7. ..
      8. ..
      9. ..
      10. Whoever reaches level 10 is worthy of being called the main holo…led (instead of dots, insert the desired one) 🙂

      And it was proposed to do all this in the mind, a task for concentration and memory

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    10. svalex

      svalex

      • 0 Questions
      • 3 Answers
      • 0 Best Answers
      • 26 Points
      View Profile
      svalex
      2020-12-27T05:01:22+00:00Added an answer on December 27, 2020 at 5:01 am

      Zaur Nashapigov:
      And there is such EA which can in the settings
      another EA to put/remove a tick “to use the EA
      trade”, that is, that the EA is trading off not at all
      terminal button (Autotrading) and certain pairs (tabs) on a specified schedule. Does anyone know if there’s anything anywhere that matches this description?

      yeah…Advisor for managing advisors… so soon they will start looking for an Advisor to manage advisors by managing advisors…ugh..

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    11. nuolin

      nuolin

      • 0 Questions
      • 2 Answers
      • 0 Best Answers
      • 24 Points
      View Profile
      nuolin
      2020-12-27T05:01:18+00:00Added an answer on December 27, 2020 at 5:01 am

      And there is such EA which can in the settings
      another EA to put/remove a tick “to use the EA
      trade”, that is, that the EA is trading off not at all
      terminal button (Autotrading) and certain pairs (tabs) on a specified schedule. Does anyone know if there’s anything anywhere that matches this description?

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    12. dken

      dken

      • 4 Questions
      • 12 Answers
      • 0 Best Answers
      • 32 Points
      View Profile
      dken
      2020-12-27T05:01:04+00:00Added an answer on December 27, 2020 at 5:01 am

      imelam:

      Hello everybody! Please advise the utility (expert Advisor or something else 🙂 to enable or disable the “Automatic trading” button in MT4 on a schedule ( by the hour within the day) with the ability to set this-the schedule itself, of course. The point is that not every expert Advisor has such a function ( work on a schedule), and I want to turn on the adviser exactly when it is necessary. Already “steamed up” to look in the Internet, something I can not find anything. Maybe, who knows… Thanks ! 

      write to me in kaplickou doing such, you need to stipulate the details of the desired functionality

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    13. imelam

      imelam

      • 1 Question
      • 4 Answers
      • 0 Best Answers
      • 26 Points
      View Profile
      imelam
      2020-12-27T05:00:57+00:00Added an answer on December 27, 2020 at 5:00 am

      Mikalas:

      In order to stop trading, it is not necessary to click on the button.

      Write a schedule in the expert Advisor and disable it according to this schedule.

      🙂 The problem is that I do not know this language. Before that, I studied a little javascript and use… Therefore, you need a utility or that someone wrote the code 🙂

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    14. mikalas

      mikalas

      • 0 Questions
      • 3 Answers
      • 0 Best Answers
      • 26 Points
      View Profile
      mikalas
      2020-12-27T05:00:52+00:00Added an answer on December 27, 2020 at 5:00 am

      imelam:

      Hello everybody! Please advise the utility (expert Advisor or something else 🙂 to enable or disable the “Automatic trading” button in MT4 on a schedule ( by the hour within the day) with the ability to set this-the schedule itself, of course. The point is that not every expert Advisor has such a function ( work on a schedule), and I want to turn on the adviser exactly when it is necessary. Already “steamed up” to look in the Internet, something I can not find anything. Maybe, who knows… Thanks ! 

      In order to stop trading, it is not necessary to click on the button.

      Write a schedule in the expert Advisor and disable it according to this schedule.

      void OnTick()
      {
        if ( stop_trading ) return;
        //Your code....
      }

      • 0
      • Reply
      • Share
        Share
        • Share on Facebook
        • Share on Twitter
        • Share on LinkedIn
        • Share on WhatsApp
    Leave an answer

    Leave an answer
    Cancel reply

    Browse

    Sidebar

    Ask A Question

    Stats

    • Questions 504
    • Answers 2k
    • Posts 5
    • Comments 0
    • Best Answers 0
    • Users 674
    • Popular
    • Comments
    • Tags
    • forexcommunity

      Highlighting what’s important about questions & Answers on Discy Community!

      • 0 Comments
    • forexcommunity

      Introducing Keyboard Shortcuts, our first Labs feature

      • 0 Comments
    • forexcommunity

      Defining quality on Discy Engine — what a helpful answer ...

      • 0 Comments
    • forexcommunity

      Organizational and company accounts on Discy Engine the next step

      • 0 Comments
    • forexcommunity

      Hello world!

      • 0 Comments

    Related Questions

    • Brus Agell

      Правельный выбор

      • 0 Answers
    • pinupcasinoo

      Pin Up Casino

      • 0 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 2 Answers
    • c00l777

      During optimization, indicators that are not present in the robot ...

      • 0 Answers
    • c00l777

      Optimization results differ on different accounts

      • 3 Answers

    Users

    RobertFoeta

    RobertFoeta

    • 0 Questions
    • 0 Answers
    Brus Agell

    Brus Agell

    • 1 Question
    • 0 Answers
    pinupcasinoo

    pinupcasinoo

    • 1 Question
    • 0 Answers

    Footer

    First independent community of traders

    About

    An independent community of forex traders. This is where traders communicate. You can ask your questions and you will receive an answer to your question.
    • Terms of Use
    • Privacy Policy
    • Cookie Policy
    • Knowledge Base
    • Support

    © 2021 Forexcommunity.net. All Rights Reserved