Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1039
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
Service -> Settings -> History Max Bar and Max BarGraphs in Window
Now the speed. Most indicators handle only one, last bar on each tick. Or 2 when a new bar appears. But there are indicators that calculate many or even all bars on every tick due to programming errors or due to a specific algorithm. First, we need to identify them. This can be done using the Task Manager, by determining the CPU load. Or, more precisely, you can insert into the indicator something like
It is unlikely that the indicator should recalculate all the bars. We should check 1) what this indicator returns by the operator return 2) the number of recalculated bars in the indicator code. 3) Max bars in the window 4) The indicators, called by the iCustom function, should not be in the chart. Otherwise we get the duplication of the indicator and increase the load on the processor.
I type the text in Word and copy it through the clipboard to improve the literacy. Otherwise, four syntax and one comma...
Good day, colleagues!
Please tell me what the problem is with this piece of code:
Referring to TF without square brackets, i.e. without specifying an index, is meaningless. Which array element should I use?
I suppose you could use something like for(int NTF=0;NTF<6;NTF++) for(int i=iBars(NULL,TF[NTF]);i>=0;)
Good day, colleagues!
Can you tell me what the problem is with this bit of code?
TF is described as an array of 6 elements. i.e. there are: TF[0]=1, TF[1]=5, TF[2]=15, TF[3]=30 TF[4]=60 TF[5]=240
Accessing TF without square brackets, i.e. without specifying an index, is meaningless. Which array element should I use?
I suppose you could use something like for(int NTF=0;NTF<6;NTF++) for(int i=iBars(NULL,TF[NTF]);i>=0;)
Thanks, guys)
So, the fact that I defined variable TF in the firstfor(int TF=0;TF<6;TF++) operator, the compiler confuses it with an array?
It's worse... TF is declared twice 1) as an array 2) as an integer variable. The second declaration covers (makes invisible, almost destroys) the first one.
The compiler will first generate the warning: declaration of 'TF' hides local declaration ... The second declaration of TF hides the previous one. Now TF is not an array but an integer variable. That's why the next use of TF[] requires an array that is already hidden, and the error: '[' - array required Array required.
It's worse... TF is declared twice 1) as an array 2) as an integer variable. The second declaration closes (makes invisible, almost destroys) the first one.
The compiler will first generate the warning: declaration of 'TF' hides local declaration ... The second declaration of TF hides the previous one. Now TF is not an array but an integer variable. That's why the next use of TF[] requires an array that is already hidden, and the error: '[' - array required Array required.
That's it... I see, thank you very much.
fixed everything, no errors are returned (however, I was confused by the fact that when I declared variable f instead of variable TF, there were no errors using TF[TF]),
but the script doesn't open in the terminal, maybe it's about warnings?
Service -> Settings -> History Max Bar and Max BarGraphs in Window
Now the speed. Most indicators handle only one, last bar on each tick. Or 2 when a new bar appears. But there are indicators that calculate many or even all bars on every tick due to programming errors or due to a specific algorithm. First, we need to identify them. This can be done using the Task Manager, by determining the CPU load. Or, more precisely, you can insert into the indicator something like
It is unlikely that the indicator should recalculate all the bars. We should check 1) what this indicator returns by the operator return 2) the number of recalculated bars in the indicator code. 3) Max bars in the window 4) The indicators, called by the iCustom function, should not be in the chart. Otherwise we get the duplication of the indicator and increase the load on the processor.
I type the text in Word and copy it through the clipboard to improve the literacy. Otherwise there are 4 syntax and 1 comma...
Ekburg!!! All warnings should be eliminated. The first warning means that the statement has no effect - discarded by the compiler - this is bad. The last warning is that the size of the local variable (array) exceeds 512kB and therefore has no effect - that's too bad. The rest of the warnings - an uninitialized variable might be used. It's like when you forget to put money on the card and try to spend it. We have to check all the branches of the program. Sometimes the compiler is over-insured. In this case you should declare it this way: int x=0; string y=""; bool z=false;