Indistinctkiller:
if(time[]>8:00 && time[]>12:00 && (all the other statements that are part of the indi...) { signal... }Does anyone know how to do this in mql5?
-
Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum 2019.05.06
Messages Editor - Don't you mean 8:00 <= time && time < 12:00 [08:00…12:00)? Right now you have (12:00…24:00)
- Obviously that isn't valid code.
- There are several ways.
#define HR0800 28800 #define HR1200 43200 // (12*3600) SECONDS now = time(time[]); if(now>HR0800 && now>HR1200 && (all the other statements that are part of the indi...){
Find bar of the same time one day ago - MQL4 programming forum 2017.10.06
So far I have tried many things but, ether the methods found were not compatible with my code (I don't get errors, just my implied intention with what I coded dosen't work) or I sheerly didn't understand how to implement it into my code(i.e I was to stupid)
I looked at a few posts on the forum to see what other people did using things like MqlDateTime or just using the default time[] array in oncalculate.
I've also tried using TimeToString or StringToTime. Nothing really worked for me.
I am running a for loop using i. When the conditions in the if statement are met a signal is posted.
So at the the moment I am looking for a way to implement the time issue mentioned above into this if statement of the for loop.
So something like
obv very simplified version of the code.
Does anyone know how to do this in mql5?
Help is greatly appreciated <3
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px 'Helvetica Neue'} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px 'Helvetica Neue'; min-height: 16.0px}