[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 228

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
Where is the best place to declare a variable type (int, double, etc.) in terms of reducing the resource consumption of program execution. For example, int i can be declared globally or in int start() ... for (int i=OrdersTotal()-1; i>=0; i--) ... I have a feeling that declaring on every tick is more costly than declaring once on global level, right after extern parameters. Or is the difference in resource-intensiveness the same?
All variables (memory locations) are created once at program start and must then be initialized where they occur in the text(variable declaration), but this does not always happen, so if you want it to work properly, do not forget to initialize it explicitly when declaring.
Corrected the code to match yours.
When testing, four orders closed in order of setting on the first tick, the fifth closed on the next tick. Probably something else is wrong here as I have tested repeatedly.
I am providing you the code of the program and logs of the tester.
Sincerely. Shurkin
It's clear. Replace
to .
There is the following situation:
I have shown a piece of code where there is a misunderstanding. All variables are declared global. In theIsObjectFound() function I get the values of the first and second price point of the object, the name, and the price value of the object on the current bar. If the object is found it should exit the function in true mode , otherwise infalse .
In the start, I prescribed a condition that if the object is not found, then I exit the function:
I run it in the tester, I didn't draw any objects, there is nothing - a bare graph. Nevertheless, the function does not quit and is not printed accordingly :
The start function goes on and on. What is this all about?
Global variables are global searches. What can you say about the algorithm without seeing the data model?
I would trace exactly the data. And isObj really boolean, and all that ...
Global variables are global searches. What can you say about the algorithm without seeing the data model?
I would trace exactly the data. And isObj really boolean, and all that ...
isObj is an int. Returns the window that has the object in it, if there is one. If it does not exist, I understand it will return -1. According to the doc, the main window starts at 0 and then the sub-windows... So far, this is an outline for a trading Expert Advisor, purely signal. But it gives out messages whenever it wants.