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
Do not start new topics with the same subject.
This is the 2nd time that you have been told. Next time you can expect a ban.
I have deleted your new topic.
Missing false.
No false code needed.
startTrade = TimeCurrent()>=waitUntil;
Missing false.
No false code needed.
Do not start new topics with the same subject.
This is the 2nd time that you have been told. Next time you can expect a ban.
I have deleted your new topic.
Not tested, not compiled, just typed.
Not tested, not compiled, just typed.
See also
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum (2017)
Pretty complex ways I see here. Not sure if a #defined value is required in your code.
To start at the beginning of the 7th day
You could also use D1/W1 timeframe, but then you have to deal with 4066 / synchronization issue; just as complex.
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
You could also use D1/W1 timeframe, but then you have to deal with 4066 / synchronization issue; just as complex.
On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)
I've never ever experienced what you mentioned on MT4. What you linked to is referring to referencing historical data. We are not referencing historical data, We arent even referencing the current bars data, except for Time. Data is loaded from current bar first and backwards. We are just using the value of PERIOD_D1 to calculate the number of seconds we need to add to the current bar time to calculate a FUTURE date value.
I use this all the time. Here's the pseudocode
Make a script that will read D1 data. Stop the terminal. Delete the D1 history files. Start the terminal. Run the script on any other timeframe.
Just because you haven't seen it doesn't mean it doesn't occur. Other charts stop updating ten (10) minutes after last access.
I've never ever experienced what you mentioned on MT4. What you linked to is referring to referencing historical data. We are not referencing historical data, We arent even referencing the current bars data, except for Time. Data is loaded from current bar first and backwards. We are just using the value of PERIOD_D1 to calculate the number of seconds we need to add to the current bar time to calculate a FUTURE date value.
I use this all the time. Here's the pseudocode
datetime restriction_lift_date;
bool isTradeRestricion(){
if (Time[0] >= restriction_lift_date) {return false; else return true;}
}
void AddTradeRestriction(period, periodMultiplier)
{
restsriction_lift_date = iTime(_Symbol, period, 0) + PeriodSeconds(period) * periodMultiplier;
}