Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1106
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
this will work:
Most likely you have described the structure at global level, and there at global level you wanted to assign values to the fields of the structure, this will not work
Thanks for the reply.
Can you tell me, when I write #define FXT_HEADER.intSize 70, why it gives an error?
Hello!
Trying to make a moving Average function from iAD(). It didn't work out to the end. The function in the above version outputs the value of moving Average from iAD() on the current bar. It does not depend on the value of the shift variable.
But I need the shift variable to be the index of the bar where the function returns the corresponding value of the moving Average from iAD(). The described error was detected by the following code inserted into OnTick():
If anyone can, please advise how to fix the error.
Can you help me with a primitive task?
- the indicator has a check for the account number... if the account number is not the one specified - the indicator gives a message (the indicator is just for friends, etc.)
- after the indicator is installed on a chart - everything is working fine ... check goes through... the indicator works
But after restarting the terminal - indicator fails the test ... I understand that the downloading of indicator's code occurs before the connection to the broker? I have to reinstall it on the chart... This is not an option...
Can you tell me in what place to insert this code correctly? I want to be able to put it on the chart once, save it as a template and all ...
Do you know where to insert this code? So that you can put it once on the chart, save it as a template and that's it...
try putting while() before it, waiting for login within certain limits. don't know what functionAccountInfoInteger(ACCOUNT_LOGIN) gives out if not logged in yet - unprint it and paste it instead of question marks.
Try while() before that, waiting for login within certain limits. I don't know what functionAccountInfoInteger(ACCOUNT_LOGIN) gives out if not yet logged - print and paste instead of question marks.
You can not execute something long in OnInit - the terminal can unload the code
in the indicator must not slip to work
i don't understand why the source code does not work - either your broker has no good servers or the internet is too slow - usually this code is shared by your "friends" on all forums )))
i think you have to add a static check variable in the indicator body , when a tick comes it will connect to the broker and authorization, the only thing i would give the first tick when loading the chart - but it may be handled , by the way prev_calculated ==0 is a very good reason to check the "license".
I started teaching my daughter to trade. She had this question: I understand if, say, to buy a pound, but it is unclear how you can sell a pound, if I did not buy it and I do not have it. To be honest, I could not explain it to her clearly, I said something vague, that it is considered non-cash, virtual transactions and have these pounds in stock to sell, not necessarily. In general, I did not like my own answer. And what would have been the right answer to such a question?
You don't need to understand things to make a profit. The less you know, theeasier you play. I think so.
It's cool that she is able to start doing it so early) In the process she will find the answers to the questions (which she will ask herself), if there are any...You don't need to understand things to make a profit. The less you know, the easier you play. Imho.
If I tell her that when the price has gone down a decent distance and turned around, hit the buy button, and vice versa. Do you think it will be enough? )
you cannot execute something long in OnInit - the terminal may unload the code
in the indicator must not work
i don't know why the source code does not work - either your broker has no good servers or the internet is too slow - usually this code is shared by your "friends" on all forums )))
i think i need to add a static check variable in the indicator body , when a tick comes, it will connect to the broker and authorization; the only thing i see is that the first tick is loaded to the chart by itself - but it may be handled , by the way prev_calculated ==0 is a good occasion to check the "license".
I solved the same problem and inserted the following code at the beginning of OnCalculate function:
account_number is defined with #define (a global visibility variable is also possible), MeName is the same, but in general it is the short name of the indicator.
I solved the same problem by inserting this code at the beginning of the OnCalculate function:
account_number is defined with #define (you can use global visibility variable), MeName - similarly, but in general it is a short indicator name.
Yes, you have a good example, that's what I'm writing about
but you need to process the first start of the indicator - the first start may or may not be a connection, and if the license has not passed, you should unload the indicator at once, as a counter and 2-3 times no license, then unload the indicator