[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 616
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
rigonich
Is this some kind of joke or something? Where do you laugh?
TarasBY
You cannot? Well, you shouldn't have.
I've written in Russian - there's almost nothing about declaration of global variables in the textbook. For example, I don't know what fGet_MineGV() is;
Is it a function? If it is, what does it do? Search for fGet in the textbook produces zero results.
What should I declare in int init() ? You wrote:
{
fGet_MineGV();
}
Here in my EA the initialization of init looks like this:
int init()
{
ArrayInitialize(buf3,0);
ArrayInitialize(b1,0);
ArrayInitialize(b2,0);
ArrayInitialize(b3,0);
ArrayInitialize(b4,0);
Comment("Calculating average value "+ind);
m1=NormalizeDouble(iCustom(NULL,tf,ind+"_a",0,0),2);
string d="Average value "+ind+""+DoubleToStr(m1,2);
tm=TimeCurrent();
int q=0,ticket=-1;
double opr=0,lot1=0;
for(q=0;q<OrdersTotal();q++)
{
and so on, 100 more lines. Where exactly, in what place and most importantly, what exactly should I declare here? Is it really so hard to write in Russian? Let's bend our fingers, yeah.
What is the code?
By the way, puzzled over this question for a long time, but never found out, just forgot. Where does the tester get the stopplay values? If the actual values can be changed by the server, then the test result should depend on the time of the test, which is not the case, I checked. Or is the value stored in the symbol properties and the value given by the server on request not the same?
rigonich
Is this some kind of joke or something? Where do you laugh?
TarasBY
You cannot? Then don't do it.
TarasBY
ain't fucking moving, asshole. You're the freak. Because you can't even articulate two words properly in Russian.
Are you an asshole? Well, I don't need to torture you. Get some rest.
The variables from the market environment are in the symbols.raw (presumably) service file, which is located in the server history folder. When there is no connection to the server or on weekends, the terminal takes the latest data from this file.
Thank you.
rigonich
Is this some kind of joke or something? Where do you laugh?
TarasBY
You cannot? Well, you shouldn't have.
I've written in Russian - there's almost nothing about declaration of global variables in the textbook. For example, I don't know what fGet_MineGV() is;
Is it a function? If it is, what does it do? Search for fGet in the textbook produces zero results.
What should I declare in int init() ? You have written:
{
fGet_MineGV();
}
Here in my EA the initialization of init looks like this:
int init()
{
ArrayInitialize(buf3,0);
ArrayInitialize(b1,0);
ArrayInitialize(b2,0);
ArrayInitialize(b3,0);
ArrayInitialize(b4,0);
Comment("Calculate average value "+ind);
m1=NormalizeDouble(iCustom(NULL,tf,ind+"_a",0,0),2);
string d="Average value "+ind+"+DoubleToStr(m1,2);
tm=TimeCurrent();
int q=0,ticket=-1;
double opr=0,lot1=0;
for(q=0;q<OrdersTotal();q++)
{
and so on, 100 more lines. Where to, in what place, and most importantly, what exactly I should declare here? Is it really so hard to write in Russian? Let's bend our fingers, yes.
Is this a function? If so, what does it do? The textbook search for fGet gives zero results.
Yes, this function, and there can't be anything about it in the tutorial, it wasn't available at the time the tutorial was written. This is a user-defined function, which was written especially for you.
{
rigonich
I did so in the beginning. I inserted this piece of code inside the init function, compiled it, got a note:
Function "fGet_MineGV" is not referenced and will be removed from exp-file
This warning is clear to me because there's no record there yet, so it cannot read anything, right?
After that I write the second part of the code inside the function start. This fragment looks like this
void fSave_MineGV (string fs_PrefName = "") // variable name prefix
{
static datetime ldt_NewBar;
datetime ldaTBeginBar = iTime (Symbol(), 1, 0)
//---- Save at beginning of each minute
if (ldt_NewBar == ldaTeginBar) return;
ldt_NewBar = ldaTBeginBar;
//---- Save the values of each variable in turn
string ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_1");
GlobalVariableSet (ls_Name, SUA);
ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_2");
GlobalVariableSet (ls_Name, SUA1);
ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_3")
GlobalVariableSet (ls_Name, BUA);
ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_4");
GlobalVariableSet (ls_Name, BUA1);
}
Is it all right here?
I insert this part of the code right after calculation of SUA, SUA1, BUA,BUA1.
But at compilation, the Expert Advisor gives the following output:
27 error(s), 64 warning(s)
rigonich
I did so in the beginning. I inserted this piece of code inside the init function, compiled it, got a note:
Function "fGet_MineGV" is not referenced and will be removed from exp-file
This warning is clear to me because there's no record there yet, so it cannot read anything, right?
After that I write the second part of the code inside the function start. This fragment looks like this
void fSave_MineGV (string fs_PrefName = "") // variable name prefix
{
static datetime ldt_NewBar;
datetime ldaTBeginBar = iTime (Symbol(), 1, 0)
//---- Save at beginning of each minute
if (ldt_NewBar == ldaTeginBar) return;
ldt_NewBar = ldaTBeginBar;
//---- Save the values of each variable in turn
string ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_1");
GlobalVariableSet (ls_Name, SUA);
ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_2");
GlobalVariableSet (ls_Name, SUA1);
ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_3")
GlobalVariableSet (ls_Name, BUA);
ls_Name = StringConcatenate (fs_PrefName, Symbol(), "_N_4");
GlobalVariableSet (ls_Name, BUA1);
}
Is everything correct here?
The function descriptions can be placed neither in start, nor inite, nor in any other function. They must be placed separately. You can place it in the middle of your EA, or at the beginning, or at the end, but not in other functions. You should only put the function call in the init, you can put it at the very beginning.
This remark is clear to me, because the record hasn't been created yet, it can't count anything, right? Exactly, there is no function description, which the compiler looks for where it should be - outside of the pragmatic functions.
{
fGet_MineGV();
}
The same applies to the second function. This is a primer, and it's hard to assume that someone doing programming, even a beginner, can't know this.