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
Right, here's the story. I have a number of charts open and have them as plain as possible, as part of that I have the foreground colour set to "none". The downside to this is that you get no crosshair. I therefore searched for a crosshair indicator and found the one by nicolishen, which works perfectly. On the thread where I found it I noticed that people had made suggestions and he subsequently modified his indicator a number of times. As he has done this in the past, I assumed (maybe wrongly) that he wold implement my suggestions as it would certainly improve the indicator. If nicolishen had provided the source code I would be able to do this myself. He chose to release his indicator just as an ex4, though, which is fair enough.
In the meantime, I thought if nicolishen does make the modifications to his indicator then it will mean slightly different settings for a few charts and therefore a different template. This in turn means that the script I have to change templates will no longer work correctly as I will want to apply 3 different templates instead of one to ALL open charts.
While I don't have an in depth knowledge of how to code in MQL, I've started dabbling with it and modified many indicators/scripts and felt that I could do the same on this occasion. I searched many places to try and find a solution but couldn't work out how to do it. So, having seen thousands of threads where people ask for advice on MQL and thousands more on places like StackOverflow for other programming languages, I decided to ask for help here. Now I know the world is made up of many different types of people, some helpful and will readily share their knowledge, others condescending and not so helpful.
It's as though I'm Goldman Sachs and asking for 100,000 line algorithm to be written for me. All I'm asking for is advice on a SNIPPET of code and if what I want is achievable. I'm sure if someone was to provide the answer it wouldn't be much longer than the pseudo code I've written, explaining what I want. Up to now I've be told to "search for it", which I have. "Learn" MQL" (like nobody has ever asked questions before). BEG in another forum for a bit of advice and stop using anchant [sic] code.
Don't just skim over users' posts or answers! @whroeder1 gave you the answer, which included a link than includes example code. But you decided to just skim over his post instead of looking at it line-by-line.
So, I am going to "spoon-feed" you by highlighting the section of his post. Maybe this time, you will actually put in the effort and stop complaining!
So follow the link, read it and look at the example code! If you are still unsure, then search using the function name and you will find many threads on it.
Also, since this site's search does not provide a direct MQL4 search, use Google and it will provide the answer on the very first item found:
It's not applying the template that's the issue. It's the "IF", i.e if the chart is GBPUSD then apply template 1, if it's EURUSD then apply template 2, etc.
That's not what is understood from your thread title nor the initial post. You did say that it was pseudocode, so now you have to replace it with real MQL4 code.
You don't choose a market, but instead select a Chart ID from the list of open charts! ChartFirst(), ChartNext(), ChartSymbol(), ChartID() ... Chart Opertaions.
Until you learn the basics, you will not be able to explain yourself properly and you won't understand our advice. Both sides will just end up getting frustrated with each other!
So here is some reading material to help you get started:
Thank you Fernando for pointing me in the right direction.