Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1384
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
If we replace the "time value" with the difference between the new time and the last calculated time?
I.e. we will know that there is a new time:
-from the new day
-from a new week
-or with a difference of more than the specified time.
I have no idea how to apply this!
On the screenshot rollover and spread widening at 22-00, in most other dealing at 00-00, it is 1 hour after - spread widening.
How do I find out programmatically when rollover is, without limiting the program to the time in the input parameters?
---
P.S. This code behaves well, but on condition that it is run 500 ticks before rollover
I have no idea how to apply this!
In the screenshot rollover and spread widening at 22-00, in most other dealings at 00-00, it is 1 hour after - spread widening.
How do I find out programmatically when rollover is, without limiting the program to the time in the input parameters?
---
P.S. This code behaves well, but under the condition that it is run 500 ticks before the rollover
The reason of spread widening by dealing is the opening of the trading session, i.e. the "dumping" of a large number of orders for processing, and the uncertainty of how (at what price) everything will "settle". Dealing will insure and widen the spread. You just need to delay the time from the end/beginning of the trading session.
The reason for the spread widening by dealing is the opening of the trading session, i.e. a large number of orders being placed for processing, and therefore the uncertainty of how (at what price) everything will "settle". Dealing will insure and widen the spread. You just need to set aside the time from the end/beginning of the trading session.
Yes, but it's not in the instrument specification.
That's where the rollover is at 10:00 p.m.
And this is the rollover at 00-00.
Yes, but it is not in the tool specification
Hopefully, the final version will take everything into account
Hopefully, the final version will take into account all
two variables
datetime daLAST=0;
datetime daOLD=0;
In each function that can "trade", i.e. it can get the time of the tick
daOLD = daLAST;
daLAST= "tick time"
If ( daLAST - daOLD > "time gap") - a new session started, there was a time gap
{
//save, use and cancel this as you please
}
two variables
datetime daLAST=0;
datetime daOLD=0;
In each function that can "trade", i.e. can get the time of the tick
daOLD = daLAST;
daLAST="tick time"
If ( daLAST - daOLD > "time gap") - a new session started, there was a time gap
{
//save, use and cancel this as you please
}
There are some pairs and dilemmas where the Asian session may not have a tick for up to several minutes, with a rollover time of 21-59 to 22-01, that is faster than the arrival of the tick in Asia.
There are some pairs and dillings on which in the Asian session there may be no tick for up to several minutes, with rollover time from 21-59 to 22-01, i.e. faster than the arrival of the tick in Asia.
back to square one then.
what is the objective? to skip trades with an exorbitantly widened spread - right?
Then we can probably ignore the time and analyze the spread itself.
if Ask - Bid > "threshold" - enable tracking/accumulation.
ifAsk - Bid < "threshold" - switch it off or also accumulate.
Such a "cow" seems to come in handy for me too, I'll collect something like this, it will collect statistics...
And if there is no fresh tick for some minutes, it will be more reasonable to skip the first one(s) in trade.
The statistics should be collected on specific pairs and dillings, because any "curvature" may work both in "-" and in "+".
let's go back to square one then.
what is the objective? to skip trades with an exorbitantly widened spread - right?
Then we can probably ignore the time and analyse the spread itself.
if Ask - Bid > "threshold" - enable tracking/accumulation.
ifAsk - Bid < "threshold" - switch it off or also accumulate.
Such a "cow" seems to be useful for me too, I will collect something like this, it will collect statistics...
And if there is no fresh tick for some minutes, it will be more reasonable to skip the first one(s) in trade.
The statistics should be collected for particular pairs and dillings, because any "curvature" may work as in "-" as in "+".
All that you described makes the code above, except for yellow - I think it is redundant and not quite correct. Somehow never met, that rollover was someone at other time, always all in one and the same - at 22-00 GMT, although I can be mistaken.
But often seen different duration rollover, some 5 minutes, and others a little over a minute.
---
Check code, maybe change something:
Everyone's at the same time - 10pm GMT, although I could be wrong.
You're not wrong.