How to apply one set of settings per EA per MT4?

206 views
Skip to first unread message

Mario Lukačić

unread,
Aug 29, 2018, 11:03:09 AM8/29/18
to NJ4X Forum
Hi

I am running 20+ MT4 on various brokers, each of these MT4 run an EA with special settings (including symbol with suffix ). 

I managed to extract suffix, preset the various settings required for each EA, and save it into template file, now i run into the following issue:

When i load a chart using ChartOpen(), it opens my EA, but after template is applied with ChartApplyTemplate() it removes my EA completely.

Is there another way of doing this, importing custom chart settings into each EA ? We run one EA per Terminal only in addition to jfx. 

Each EA have different custom settings created from our database into a template file.

Thanks in advance

Roman Gerasimenko

unread,
Aug 29, 2018, 11:22:27 AM8/29/18
to NJ4X Forum
Seems you're doing something wrong.. Check your template is configured correctly, check errors at terminal's journal tab (you need to make term visible first). 
ChartApplyTemplate applies everything from a template including EA.

ср, 29 серп. 2018 о 18:03 Mario Lukačić <mluk...@gmail.com> пише:
--
You received this message because you are subscribed to the Google Groups "NJ4X Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nj4x+uns...@googlegroups.com.
To post to this group, send email to nj...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mario Lukačić

unread,
Aug 29, 2018, 12:12:41 PM8/29/18
to NJ4X Forum
Even if i make it visible first, nothing changes, but interesting thing is that there is no errors in app, exception or Journal inside of TS. 

But if i right click on chart -> Template, and i select mine template and click it all works, it loads it with EA and all mine settings. See on image http://prntscr.com/kobcr3

I checked template, i even saved it from chart first, but that is not helping too.

This is from Journal in MT4 http://prntscr.com/kobcds

Roman Gerasimenko

unread,
Aug 29, 2018, 12:28:23 PM8/29/18
to NJ4X Forum
How can I help..?

There is NJ4X EA management API (see description here - https://1drv.ms/u/s!AqAmwEMj2h0umPFo08EWBGmc_HOsuA)
It is proven to run any EA in production mode using ChartOpen/ChartApplyTemplate methods.

It costs $500.

ср, 29 серп. 2018 о 19:12 Mario Lukačić <mluk...@gmail.com> пише:

Mario Lukačić

unread,
Aug 29, 2018, 12:50:45 PM8/29/18
to NJ4X Forum
Not sure how you can help, but from API docs ChartApplyTemplate() remarks says "The Expert Advisor will be unloaded and will not be able to continue operating in case of successful loading of a new template to the chart it is attached to. ".

I already loaded EA with ChartOpen(), then i use ChartApplyTemplate() just to apply template to chart, and in case this success it removes EA.

This have no sense to me, why unload EA if you apply template ?

if (IsConnectedToTerminal())
{
                    //turn off symbols from MW
                    foreach (var symbol in Symbols) SymbolSelect(symbol, false);

                    long chartId = 0;

                    chartId = ChartOpen("EURUSD-", Timeframe.PERIOD_H4); // open chart after connection

                    if (chartId != 0)
                    {
                        // apply template to chart
                        ChartApplyTemplate(chartId, AccountNumber().ToString() + ".tpl");
                    }

                }


Roman Gerasimenko

unread,
Aug 29, 2018, 12:56:07 PM8/29/18
to NJ4X Forum
In case you apply new template to the chart it is obvious that old EA must be unloaded - I see no problem here. Please check details about ChartApplyTemplate MQL4 method here - https://docs.mql4.com/chart_operations/chartapplytemplate

ср, 29 серп. 2018 о 19:50 Mario Lukačić <mluk...@gmail.com> пише:

Mario Lukačić

unread,
Aug 29, 2018, 1:14:14 PM8/29/18
to NJ4X Forum
Is there exists any other way to do this, because when i load EA i need to fill few Inputs before it can work properly, but as i can see this is impossible with this way i am using right now.

Roman Gerasimenko

unread,
Aug 29, 2018, 1:17:14 PM8/29/18
to NJ4X Forum
..but template already contains all EA inputs. As far as I know there is no other method to start EA with custom parameters.

ср, 29 серп. 2018 о 20:14 Mario Lukačić <mluk...@gmail.com> пише:
Is there exists any other way to do this, because when i load EA i need to fill few Inputs before it can work properly, but as i can see this is impossible with this way i am using right now.

--

Roman Gerasimenko

unread,
Aug 29, 2018, 1:20:33 PM8/29/18
to NJ4X Forum
How much time/money have you spent to solve this ..? 
Please consider tested ready to use solution.

ср, 29 серп. 2018 о 20:16 Roman Gerasimenko <roman.ge...@nj4x.com> пише:

Mario Lukačić

unread,
Aug 29, 2018, 1:26:29 PM8/29/18
to NJ4X Forum
Ok, thanks for answers.

Mario Lukačić

unread,
Aug 29, 2018, 1:28:02 PM8/29/18
to NJ4X Forum
Money, not much, but many time ... :D
Reply all
Reply to author
Forward
0 new messages