[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 54
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
What kind of constants: MA_TALKING_LONG , MA_TALKING_SHORT ?
How do you declare them ?
Take into account the visibility of variables and arrays
I set them to global... Same error.
What kind of constants: MA_TALKING_LONG , MA_TALKING_SHORT ?
How do you declare them?
show the header (declaration) of this function GetStateMa() - the problem is there
change it to GetStateMa(int signal){} should fix it
show the header (declaration) of this function GetStateMa() - the problem is there
Change it to GetStateMa(int signal){} should fix it
Well, here is the gist. One expert has corrected my Expert Advisor, it worked fine. My task was to open 1 order only for 4 different signals and each signal was generated and calculated separately. He fixed my Expert Advisor, but messed up its logic.
I started to analyze his code. His writing is brutal, I've been looking into it for the second day.
Before it went like this:
at the start:
And here are the functions to make it clear what's what:
Generally speaking, it's a funny thing to see that a function as void should not return anything by definition but nevertheless it returns the value of an element of the array signal[i].
I wonder if experienced programmers often use this? Or is it too much?
Now I'm trying to write what I need seeing the tricks that are present in that Expert Advisor. Because we cannot do without arrays there.
Anyway, here's the gist. My Expert Advisor, which has been working fine for me, has been corrected by a pro. My task was to open only 1 order by 4 different signals and each signal was generated and calculated separately. He fixed my Expert Advisor, but messed up its logic.
I started to analyze his code. His writing is brutal, I've been looking into it for the second day.
Before it went like this:
at the start:
And here are the functions to make it clear what's what:
Generally speaking, it's a funny thing to see that a function as void should not return anything by definition but nevertheless it returns the value of an element of the array signal[i].
I wonder if experienced programmers often use this? Or is it too much?
Now I'm trying to write what I need seeing the tricks that are present in that Expert Advisor. Because we cannot do without arrays there.
It's often used, the secret inint& ,double&
I've already figured that out, but I think it's already a perversion. Why make a void function then? It is not logical. You need to return something... return it through a function of int, double type...
What to do?
I've already figured that out, but I think it's already a perversion. Why make a void function then? It is not logical.
It is logical.
This function returns nothing, it performs operations on the elements of the array passed into it.
Here is my modify pending order function. When modifying, I set a new price and a new stoploss. The function works partially, but for some reason the tester is getting errors 1.
Is my function written correctly?
if((b_mod) && (priceB > Ask)) OrderModify(b_ticket,priceB,priceS,0,0,Brown);
if((s_mod) && (priceS < Bid)) OrderModify(s_ticket,priceS,priceB,0,0,Brown);
Here we should consider MarketInfo(Symbol(),MODE_STOPLEVEL) i.e.
priceB >= Ask+ MarketInfo(Symbol(),MODE_STOPLEVEL)*Point
priceS < =Bid- MarketInfo(Symbol(),MODE_STOPLEVEL)*Point
This makes sense.
This function does not return anything, it operates on the elements of the array passed to it.
So if you pass elements to a function of the double orint type, it can also perform the same operations, but without any perversions. Why complicate your life?