I want to Stop and Restart Auto Trading between the Times I have set. ?

 


Hi Guys

I want to Stop and Restart Auto Trading between the Times I have set.

mt4 How Is This Possible?

how can I do it ? :)

 

Burak Baltaci: I want to Stop and Restart Auto Trading between the Times I have set.

mt4 How Is This Possible?

how can I do it ? :)

  1. Compare current time to your start and stop times. Ignore ticks outside your range.
              Find bar of the same time one day ago - MQL4 programming forum 2017.10.06

  2. Learn to code or pay someone. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

    We're not going to code it for you (although it could happen if you are lucky or the problem is interesting).
              No free help 2017.04.21

    MT4: Learn to code it.
    MT5: Begin learning to code it.

    If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.

 
Burak Baltaci:


Hi Guys

I want to Stop and Restart Auto Trading between the Times I have set.

mt4 How Is This Possible?

how can I do it ? :)

/+------------------------------------------------------------------+
//|                                                      EaZaman.mq4 |
//|                        Copyright 2021, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
input int StartExpertHours=03;
input int EndExpertHours=21;

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

if(Hour()>=StartExpertHours && Hour()<EndExpertHours)
  {
   // Your Experts Kodu
   
  }
   
  }
//+------------------------------------------------------------------+