Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 845
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Hello. Can you tell me how to return the type value of the penultimate order in the history.
You need to find the time of the last closed order and then search for orders with a maximum closing time, but less than the last memorised time, this is what I did:
https://www.mql5.com/ru/forum/247136#comment_7555643
in my example the ticket was searched for, you would need to return the order type instead of the ticket, or knowing the order's ticket, you can find out its type...
Is it possible to apply a template to an exportable function to be exported from c++ to mql4?
I created a file of regular type with extension "srp" and wrote a primitive function there.
Then I created a file with "def" extension and specified the name of function to be exported
LIBRARY "dllmt42" EXPORTS add
Then ran it through Build - Build Solution.
I want to apply a template to my function because we are going to develop functions that work with arrays and can't do without a template.
T is highlighted but writes that there is an error help advice and is it possible, tried to rearrange? Also how such function if possible will be called from mql4 side?
look in the codebase - on MT4 they definitely were...
Right on the front page, in this thread.
Good evening. In the process of studying and learning MT5 trying to implement a generally not difficult task, but little experience and gaps in knowledge....... in general does not work, please help and assistance.
I have an indicator and expert advisor, both with open source code, both by the same author (Artem Trishkin, respect and commendation). I am trying to ask the indicator to get the actual direction at the time of asking. The indicator shows this direction with up or down arrows. The direction obtained will be used by the Expert Advisor either as a signal or as a filter, but it is still far away.
I got the indicator handle but the data values of the arrows from the indicator are a mess and I cannot figure them out.
I have not changed the indicator. I have added OnInit in my Expert Advisor:
I added OnTick:
Of course I described and initiated the appropriate overpens, arrays, defined as timeseries and td......
Used Comment and Print to check. Not immediately, but no errors, only a couple of warnings, I do not understand. But the main thing - the parameters are defined incorrectly. Despite the condition below, maximum number for double for up arrow and some negative number for down arrow are output.
Here are the files
You would start by testing getting data from the indicator with a simple test EA, rather than taking it from an article with lots of unnecessary features for the test.
Just create a simple Expert Advisor in the MQL Wizard and use it to practice using iCustom()
Good evening. In the process of studying and learning MT5 trying to implement a generally not difficult task, but little experience and gaps in knowledge....... in general does not work, please help and assistance.
I have an indicator and expert advisor, both with open source code, both by the same author (Artem Trishkin, respect and commendation). I am trying to use the EA to ask the indicator to get the current direction at the time of asking. The indicator shows this direction with up or down arrows. The direction obtained will be used by the Expert Advisor either as a signal or as a filter, but it is still far away.
I got the indicator handle but the data values of the arrows from the indicator are a mess and I cannot figure them out.
I have not changed the indicator. I have added OnInit in my Expert Advisor:
I added OnTick:
Of course I described and initiated the appropriate overpens, arrays, defined as timeseries and td......
Used Comment and Print to check. Not immediately, but no errors, only a couple of warnings, I do not understand. But the main thing - the parameters are defined incorrectly. In spite of the condition below, the maximal number for double for up arrow and some negative number for down arrow are printed.
Artyom correctly said and I'll just note needlessness of one comparison
If CopyBuffer returns the number of elements copied to the array, then the size of the array will be exactly that. Accordingly, the highlighted part of the condition simply duplicates the first one.
And a thought out loud: I haven't looked at the code of the indicator and the EA, so I could be wrong. Are you sure that there must be a signal in period_find range?
Artyom correctly said, and I'll just point out the unnecessaryness of one comparison
If CopyBuffer returns the number of elements copied into the array, then the size of the array will be exactly that. Correspondingly, the selected part of the condition simply duplicates the first one.
I'm thinking out loud: I haven't checked the code of the indicator and Expert Advisor, so I may be wrong. Are you sure that there must be a signal in period_find range?
Yes - it's like a filter - the frequency of signals depends on it.
You would start with a test of getting data from the indicator with a simple test EA, rather than taking it from an article with a lot of unnecessary functions for the test.
The iCustom() function will be more convenient for you.
Thank you, good advice, I will do so, at least it will be more convenient.
I will start it today.Can you tell me what is wrong with the rationing of the lot?