Discussion of article "How to Post a Product in the Market" - page 46

 
Evgenii Sidorov:

#property indicator_separate_window

#property indicator_chart_window

and how to specify 2 different displays for different buffers?

You can't. ObjectCreate can help. Draw with objects.

 
Artyom Trishkin:

You do not check the FreezeLevel - if the price is too close to, for example, the StopLoss level, the StopLoss cannot be modified. The freezing distance is just determined by the FreezeLevel level

It is not the stop that is modified here, it is the deal that is closed, or am I wrong?

 
Vladimir Khlystov:

It is not the stop that is changed, but the transaction is closed, or am I wrong?

If operations are frozen, you can't close them.
 

Hey guys!

Hope all is well.

I just created an EA what's the best way to license it for the mql market? I want to submit this EA to sell on the market but I don't want to add the wrong type of licensing if I don't have to. What do you guys recommend?

 
MOTIONCAPITAL:

Hey guys!

Hope all is well.

I just created an EA what's the best way to license it for the mql market? I want to submit this EA to sell on the market but I don't want to add the wrong type of licensing if I don't have to. What do you guys recommend?

There is only one way of offering/licensing in the MQL5 Market, read the rules:

https://www.mql5.com/en/market/rules

 
Aleksei Andarzhanov:
I have written an Expert Advisor in MQL4. I want to put it in the Market. The Expert Advisor requires two custom indicators, which are not available in the terminal. I don't understand how to attach them to the Expert Advisor before sending it for testing. And another thing. The rules say that the Expert Advisor must be ex5. If it is written in MQL4, how to make it in ex5?

It is too early for you to go to the market, if you ask such questions.

 
Evgeniy Zhdan:

You're too young to be in the market if you're asking questions like that.

I figured it out. Attached indicators to the Expert Advisor via #resource. One thing. Before that, the Expert Advisor was fast, it flew quickly in the Tester, but now the speed has decreased ten times. I have done everything according to the rules, as it is written in the Guide, I have inserted a function to find the path to the indicator GetRelativeProgramPath() - but the speed is turtle, one day tests 5 minutes....

 
Aleksei Andarzhanov:

Got it. Attached indicators to the Expert Advisor via #resource . But one thing... Before that, the Expert Advisor was fast, it flew quickly in the Tester, but now the speed has decreased ten times. I have done everything according to the rules, as it is written in the Guide, I have inserted a function to find the path to the indicator GetRelativeProgramPath() - but the speed is turtle, one day tests 5 minutes....

Is the indicator data polled on every tick?

 
Denis Nikolaev:

is the indicator data polled on every tick?

Yes. Everything remains as before in the code. Only the location of the indicator has changed. Earlier it was requested from the terminal from \\Indicators, and now it is requested from the ex4 programme itself.

#resource "\\Indicators\\\\##Contrast.ex4"

///////////

string path=GetRelativeProgramPath();

path=path+"::Indicators\\##Contrast.ex4";

ContrastMain_15 =NormalizeDouble(iCustom(NULL,15,path,coeff_1,0,0),Digits);

ContrastSignal_15 =NormalizeDouble(iCustom(NULL,15,path,coeff_1,1,0),Digits);

//////////

string GetRelativeProgramPath()

{

int pos2;

//--- get the absolute path to the programme

string path=MQLInfoString(MQL_PROGRAM_PATH);

//--- find the position of the substring "\MQL4\"

int pos =StringFind(path,"\\MQL4\\\\");

//--- substring not found - error

if(pos<0)

return(NULL);

//--- skip the "\MQL4" catalogue

pos+=5;

//--- skip unnecessary '\'

while(StringGetCharacter(path,pos+1)=='\\\')

pos++;

//--- if it is a resource, return the path relative to the MQL4 catalogue

if(StringFind(path,":::",pos)>=0)

return(StringSubstr(path,pos));

//--- find a delimiter for the first subdirectory in MQL4 (for example, MQL4\Indicators)

//--- if it is absent, return the path relative to the MQL4 catalogue

if((pos2=StringFind(path,"\\\",pos+1))<0)

return(StringSubstr(path,pos));

//--- return the path relative to the subdirectory (for example, MQL4\Indicators)

return(StringSubstr(path,pos2+1))

}

 
Aleksei Andarzhanov:

Yes. Everything is the same as before in the code. Only the location of the indicator has changed. Earlier it was requested from the terminal from \\\Indicators, and now from the ex4 programme itself.

#resource "\\Indicators\\\\##Contrast.ex4"

///////////

string path=GetRelativeProgramPath();

path=path+"::Indicators\\\##Contrast.ex4";

ContrastMain_15 =NormalizeDouble(iCustom(NULL,15,path,coeff_1,0,0),Digits);

ContrastSignal_15 =NormalizeDouble(iCustom(NULL,15,path,coeff_1,1,0),Digits);

//////////

string GetRelativeProgramPath()

{

int pos2;

//--- get the absolute path to the programme

string path=MQLInfoString(MQL_PROGRAM_PATH);

//--- find the position of the substring "\MQL4\"

int pos =StringFind(path,"\\MQL4\\\");

//--- substring not found - error

if(pos<0)

return(NULL);

//--- skip the "\MQL4" catalogue

pos+=5;

//--- skip unnecessary '\'

while(StringGetCharacter(path,pos+1)=='\\\')

pos++;

//--- if it is a resource, return the path relative to the MQL4 catalogue

if(StringFind(path,":::",pos)>=0)

return(StringSubstr(path,pos));

//--- find the separator for the first subdirectory in MQL4 (for example, MQL4\Indicators)

//--- if there is no such delimiter, return the path relative to the MQL4 catalogue

if((pos2=StringFind(path,"\\\",pos+1))<0)

return(StringSubstr(path,pos));

//--- return the path relative to the subdirectory (for example, MQL4/Indicators)

return(StringSubstr(path,pos2+1));

}

What a mess...
In iCustom() you should substitute such a path:
"::Indicators\\\\##Contrast.ex4".