Dear Friends,
For example, I want to open a Sell/Buy position at the 12:05 o'clock. how can I do it?
it seems that it is not very difficult for you to help me.
I am really thankful
How do you know how difficult it is if you don't know how to do it??
How do you know how difficult it is if you don't know how to do it??
I do believe that my question is not very difficult for the person who has knowledge in mql5 coding, but I have no knowledge enough to solve my problem
hi dear
I do believe that my question is not very difficult for the person who has knowledge in mql5 coding, but I have no knowledge enough to solve my problem
Hi
In Metatrader OnTick() function is called when forming a candle, which does not know what hour or minute the event will take place.
I think you get the current server time using TimeTradeServer (dt_struc)
Then turn it into seconds.
For example:
your clock=12:05:30
current time server=11:01:00
long TimeRemainingInSeconds=((12-11)*60*60)+((05-01)*60)+30;
and call ontimer() function:
OnTimer(1sec);
and then in OnTimer function:
if(TimeRemainingInSeconds==0)///////////////////////////At this point the server clock is equal to the clock you want(12:05:30)
{
sendorder();
}
else
{
TimeRemainingInSeconds--;
}
I hope my solution works.
If you have any questions, I'm at your service.
- www.mql5.com
You wait for a tick. Check if the time is 12:05. If not don't open. If so, open. When in doubt, THINK.
In some markets (for example Iran market)
It is known as the Pre-Opening phase from 08:30 to 9:00 (meaning no deals are made and the buyer or seller sends the order Only but No deals, so no candels will be made during this time).
In fact, the trading time is from 9:00 to 12:30 .
Dear Friends,
For example, I want to open a Sell/Buy position at the 12:05 o'clock. how can I do it?
it seems that it is not very difficult for you to help me.
I am really thankful
Though I konw, but sorry you are not my dear friend.
Try this.
if(Hour()==12 && Minutes()==5) { //Your code here. }
Try this.
Dear Joel,
thanks dear
In some markets (for example Iran market)
It is known as the Pre-Opening phase from 08:30 to 9:00 (meaning no deals are made and the buyer or seller only orders but no deals, so no candles will be made during this time).
In fact, the trading time is from 9:00 to 12:30.
Dear Milad,
thanks.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear Friends,
For example, I want to open a Sell/Buy position at the 12:05 o'clock. how can I do it?
it seems that it is not very difficult for you to help me.
I am really thankful