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
Well look at your code yourself. The condition if(timeOntrade.hour==4 || timeOntrade.hour==15 || timeOntrade.hour==16) is useless in its present form. Because no matter what result it produces, your bool function timeOntrade() will always return true.
alph, this is what Yedelkin is talking about.
These variants of the function are identical in our mind
Sounds logical, that's why I'm interested. It seems to me that I wrote unnecessary unnecessary things and may have missed the necessary ones.
There is one more thing that is not clear to me yet
That is, if I understand correctly, we first assign the clock to 0 and then compare it.
Where is the logic?One more point, which is not yet clear to me
That is, if I understand correctly, we first assign the clock to 0 and then compare it.
Where is the logic?I haven't removed the line with true yet, but it seems to me, if we remove it, there will be no comparison with clock as a specific value or parameter in ontik.
At the moment these options are identical in my opinion
In general, I don't understand why values need to be assigned.
That is, as far as I understand, the best option is
In this case, if the current server time (only for clock) is not equal to the set one, then it returns false, otherwise it returns true.At the moment these options are identical
I actually don't understand why we need to assign values?To write this:
void OnTick()
{...
//-----------------------------------------------------------------------------------------+
//Base for switching to Open
MqlRates rt[1];
if(CopyRates(Symbol(),MyTframe,0,1,rt)<0) return;
if(rt[0].tick_volume>1) return;
if(!PositionSelect(_Symbol) && (timeOntrade(4) || ((timeOntrade(15) || timeOntrade(16))&& timeOntrade2(0)))) Open();//go to position opening
timeOntrade.min = 0;
This is clearly unnecessary in this context
alph:
To put this in:void OnTick()
Try this option. If not then I don't understand what you're trying to get...
Try this option. If not then I don't understand what you're trying to get...
Yes, yes, and in:
Yes, yes, and in:
Then already so (to be sure). But, in principle, you got me right
Then it's like this (to be sure). But, in principle, you got me right