Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 930
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
DiPach , thanks again for your help. I have analysed your examples. Made some changes to my startup code. The result is this:
What was changed:
1. moved the line containing int awd1[]; array declaration inside OnStart() function
2. Added the ArrayResize(awd1,6,7) function;
3. The script works.
I will try to draw conclusions. In scripts, it is correct to declare arrays inside the OnStart() function. After the array is declared, it must be necessarily defined in size using the ArrayResize() function; otherwise the compiler will generate an error. Are my conclusions correct? If not, please give me a correct interpretation.
Generally speaking, yes. And it will work, at least silently, but very well. :)
I will only specify the following points:
1. When declaring normal variables and arrays, I think you should consider what the script (or EA/indicator) is going to do and what these variables/arrays are intended for.
Your attached script workflow allows for declaration of variables not on a global program level, but locally. That is, the array is declared once. We don't need looped declarations in the Start() body, for example, before starting the for() loop and when we need further declaration of some variables after for() {}:
Accordingly, the array is declared not at the level of global variables of the program but in the body of OnStart() before the for() loop's statement - it is quite acceptable in this scheme of program execution.
From my point of view, if there's no need to declare something at the level of global variables in a program, we'd better use this opportunity and declare everything we can locally.
2. As for the code, let me make it clear:
That is:
That's the way 5 would be appropriate for for:
P./S.: One more clarification, just in case, using ArrayResize() - for dynamic arrays. In the documentation to this function , there is information when this function cannot resize dynamic arrays.
Why can't I add friends?
Hello! How can I make the new price be shown first and the previous price drop to the bottom and so on? I made an example to make it clear.
Hello! How can I make the new price be shown first and the previous price drop to the bottom and so on? That would be clear made an example.
I made an example, and with the conditions more or less you can figure it out yourself:
I've made an example, and you can work out the terms more or less on your own:
Hello! How can I make the new price be shown first and the previous price drop to the bottom and so on? To make it clear, I made an example.
Here is a completely primitive code.
Here's a perfectly primitive code made.
Hi all. Tried to open a trade order in the strategy tester using a rudimentary script, failed.
int start()
{
//----
int res;
double ask=Close[0]+MarketInfo(_Symbol,MODE_SPREAD)*Point;
res=OrderSend(Symbol(),OP_BUY,0.1,ask,3,0,0,",0,0,Blue);
if(res>-1)Alert("Open BUY order with ticket ",res);
//----
return(0);
}
I put the script on the tester chart in visualization mode, but the trade order opens in MT4 terminal.
I also cannot get information about open orders in the strategy tester using SimpleFXTester_v2.ex4.
Please help me to understand this.
Hi all. Tried to open a trade order in the strategy tester using a rudimentary script, failed.
int start()
{
//----
int res;
double ask=Close[0]+MarketInfo(_Symbol,MODE_SPREAD)*Point;
res=OrderSend(Symbol(),OP_BUY,0.1,ask,3,0,0,",0,0,Blue);
if(res>-1)Alert("Open BUY order with ticket ",res);
//----
return(0);
}
I put the script on the tester chart in visualization mode, but the trade order opens in MT4 terminal.
I also cannot get information about open orders in the strategy tester using SimpleFXTester_v2.ex4.
Please help me to understand this.
Hi.
Can't delete the terminal!
C:\$Recycle.Bin\S-1-5-21-436374069-1993962763-854245398-500\$RSU1FJ4\$R33JNRS
"Sitting" here, delete the folder and it's restored again.... and don't know what to do.
Turned off UAC, doesn't help.