- MT4: Learn to code it.
MT5: Learn to code. 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 yours. - or pay (Freelance) someone to code it.
Hiring to write script - General - MQL5 programming forum
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
You code it to do that.
- MT4: Learn to code it.
MT5: Learn to code. 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 yours. - or pay (Freelance) someone to code it.
Hiring to write script - General - MQL5 programming forum
Find bar of the same time one day ago - Simple Trading Strategies - MQL4 programming forum
I am talking about the code!! (MQL4). I have done my expert but still missing how to make it trade on a time frame.
Stop selling yourself. If you got an answer just say it. We all know that we can Hire a freelancer as I have done this before :)
Hello,
I want my expert to NOT trade between 12am till 10am. How can I do that?
Thanks
Damati
Try this code.
Your function will never return true.
Please use the code button or Alt + S and paste code instead of an image.
hi
This code is used to control the trading time.
void OnTick()
{
if(Hourfilter()== true)
int
tiketbuy=OrderSend(Symbol(),OP_BUY,lot,Ask,Slippage,Ask-(StopLoss*Point),0,"R1",1111,0,clrBlue);
}
//+------------------------------------------------------------------+
bool Hourfilter()
{
if(Hour()>=strattime && Hour()<=endtime)
return(true);
else
return(false);
}
hi
This code is used to control the trading time.
//+------------------------------------------------------------------+ bool Hourfilter() { if(Hour()>=strattime && Hour()<=endtime) return(true); else return(false); }
Your code will fail with starttime 10, endtime 2 for example.
Your code will fail with starttime 10, endtime 2 for example.
I wrote a comprehensive code.
This code can be customized.
This code is used for simple ea models.
Set the start
time to 2 and the end time to 10, or vice versa.
For example for the first question Mohammad
Damati:
10 am till 12 am not trade.
This code can be written in hundreds of ways.
I use this model for
my own code.
Friends If you have other models please write in this post for training
//+------------------------------------------------------------------+ bool Hourfilter() { if(Hour()>=12 && Hour()<=10) return(true); else return(false); }
I wrote a comprehensive code.
This code can be customized.
This code is used for simple ea models.
Set the
start time to 2 and the end time to 10, or vice versa.
For example for the first question Mohammad
Damati:
10 am till 12 am not trade.
This code can be written in hundreds of ways.
I use this model
for my own code.
Friends If you have other models please write in this post for training
Thank you very much. The exact code is not working. BUT I have took the idea and the below code works well for me:
(Hour()>=10)
&&(Hour()<=23)
Without the bool and also it will continue the 'IF' once its >10 and <23
Thanks again and cheers
I wrote a comprehensive code.
This code can be customized.
This code is used for simple ea models.
Set the
start time to 2 and the end time to 10, or vice versa.
For example for the first question Mohammad
Damati:
10 am till 12 am not trade.
This code can be written in hundreds of ways.
I use this model
for my own code.
Friends If you have other models please write in this post for training
You are not listening. Your logic is flawed.
if(Hour()>=12 && Hour()<=10) return(true);
Please give me one value for Hour() where this will return true.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
I want my expert to NOT trade between 12am till 10am. How can I do that?
Thanks
Damati