[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 645
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
There's hardly any logic to it - the simple output of lines in order one after the other...
I would use functions to make it easy to understand
I also wondered about it, but did not find anything useful. When it comes to optimization, you already know about the great brake of iCustom :), in indicators there is a restriction on the number of bars, that can be calculated (through IndicatorCounted() or by the number of bars). In the code, there is no sense to bother with the number and complexity of different constructions like if, while, etc. You won't gain much, but with time and experience, the code will become more "beautiful". Well, in visualization mode, when every "bounce" is modeled, it will be slow almost in any case (depending on complexity of the system, of course). Somewhere I read that if complex calculations in a dll, it will be faster, but I have not checked it. With dll, also enough nuances.
I remember that commands like TimeCurrent() slowed down much (when there are several of them in the code).
- It's much better to use it once - put it into a variable, and then access the variable.
I would use the functions for easy perception
I remember commands like TimeCurrent() being very slow (when there are several of them in the code)
- It's much better to use it once - put it into a variable, and then access the variable.
I remember commands like TimeCurrent() being very slow (when there are several of them in the code)
- It's much better to use it once, i.e. store it in a variable and then access the variable.
How do I correctly set such a variable so that it can be called later?
I declare it in global variables first
datetime CurTime;
And then in start()
I assign a value to it:
CurTime=TimeCurrent();
and I get an error: 'CurTime' - variable expected.
How to do it correctly?
And another question: if I assign values to some variables not in start() but in init(), will they work correctly?
Well, I mean, that some functions, e.g. TimeCurrent(), will still be called on every tick, if a variable is assigned to this function at the beginning of start()
Bummer! CurTime gives an error and CurrTime does not... What's the point?
The point is that CurTime is the obsolete name of the TimeCurrent function, so when a variable name matches a function name, the compiler always frowns...
Friends, my personal logic block is a bit on the fritz. I can not decide how to be in this situation:
We work in two directions, i.e. Buy and Sell have their own separate control units. Positions may be opened counter-directionally, it all depends on which way the market moves in each TF.
Suppose the situation when Sell and Buy are open (on M5 and M15) and suddenly the market turns in the opposite direction, opposite to the open Sell on M5 and M15 (well, whatever the situation is in the world...). In this case, all of the open Sells begin to greatly increase the drawdown, and since we have also open Buy, it is possible to close some positions in both Buy and Sell, to close loss-making sells with minimal losses at the expense of closed Buy.
So, I cannot decide on the logic of this situation. What it should be?
Just in case, here is an example:
Good people, getting back to yesterday's topic:
please tell me what the message from the logbook means:
2010.06.24 17:28:26 TestGenerator: unmatched data error (volume limit 5357 at 2010.01.06 08:00 exceeded)