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
@harryma23, some advice ...
Before using the Standard Library, you should strive to first fully understand the functional mechanics behind the class implementations. In other words, you should at least be familiar and understand the basics of the functional aspects of how to process Timeseries and Indicator data access. Otherwise you will have difficulty understanding the logic behind the Standard Library.
In fact, I would highly recommend that you be able to program a basic EA purely using the native MQL5 functions first, so that when you start using the Standard Library, you will understand how it works behind the scenes. That will allow you to use it correctly and also how to go about extending it if necessary.
Harry, you have spent the entire thread misinterpreting what you have been told.
Forum on trading, automated trading systems and testing trading strategies
CExpertSignal: get signal results from specified bar index
Miguel Angel Vico Alba, 2025.08.31 10:44
What you propose with signal.Shift(200) does not work for scanning past bars: that parameter shifts the moving average, it does not indicate which bar to evaluate. LongCondition() always works on the current bar.
If you want to print historical signals, you need to make a bar loop and replicate the CSignalMA logic with iMA/CopyBuffer, or Inherit/edit CSignalMA to add an "evaluation shift" and thus evaluate each bar in the past.
This is not a problem of a lack of functions in MetaTrader. It is a problem that you want something outside of the intended design and do not accept what that implies: programming it yourself or commissioning someone else to do it.
Solid advice, but don't waste your time on this guy. He's not trying to understand anything, just waiting for a copy/paste.
He knows as much about programming as I do about nuclear astrophysics.
And that's not the problem. We're here to help, but you can't help someone who doesn't listen, misinterprets everything, and then blames others for confusing him.
My first post:
Forum on trading, automated trading systems and testing trading strategies
CExpertSignal: get signal results from specified bar index
Miguel Angel Vico Alba, 2025.08.31 09:58
Options:
This will allow you to print signals from the last 200 candles without using the Strategy Tester.
Forum on trading, automated trading systems and testing trading strategies
CExpertSignal: get signal results from specified bar index
harryma23, 2025.08.31 11:15
I want to inherit/edit CSignalMa and add an "evaluation shift":
But I don't know how to implement this specifically and then iterate to get the desired Print() statements.
Have you done this before? Can you give me an example signal implementation with such an evaluation_shift?
Or is there another source/tutorial that explains this approach in detail?
Solid advice, but don't waste your time on this guy. He's not trying to understand anything, just waiting for a copy paste.
He knows as much about programming as I do about nuclear astrophysics.
And that's not the problem. We're here to help, but you can't help someone who doesn't listen, misinterprets everything, and then blames others for confusing him.
My first post:
>This is not a problem of a lack of functions in MetaTrader.
Certainly. Maybe MetaTrader StrategyTester has such functions, but doesn't return them to the MQL standard library. Nevertheless, a method like "testing a Signal based on a specific bar index" should exist. So please don't gloss over the lack of such a trivial method.
>He knows as much about programming as I do about nuclear astrophysics.
It's very disrespectful of you to approach me like this, even though I asked simple, objective, clear questions. What can I do if you're beating around the bush while trying to advertise for freelancers?
The fact that you advised me to hurt DRY, replicate the signal logic, deal with buffers again, etc., shows your lack of understanding of good programming and demonstrates your disqualification in this area. And again: if you're giving irrelevant answers to a factual topic, then it's better not to answer at all, and above all: don't insult or irritate others with unprofessional, contradictory answers while talking about hiring a freelancer. My final words to you.
Harry, no one glossed over anything. From the very first reply, it was clearly explained that there is no function like checkSignal(i), and that if you want to evaluate a specific bar, you need to implement that logic yourself. That is not "advertising freelancers", it is simply stating the facts.
You keep insisting that it is a "trivial lack" in the library, but you are expecting it to work outside of its intended context. That is not trivial. What is trivial is understanding that if you want something different, it requires different code.
As for your final accusation, suggesting that you use the Freelance section when you clearly do not know how to implement what you are asking for is not an insult. It is the most honest and practical advice you can be given. What is inappropriate is returning with insults and trying to lecture others on software design after admitting that you do not even know how to implement the basic idea yourself.
Learning to program is not part of your modus operandi, is it? Clever move ...