Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 665

 
evillive:
create

create file filter.mq4 with this function and save it in \MQL4\Include\


then call from the indicator #include <filter.mq4>

if the variable response is in the indicator, you don't need to declare it, just use it where necessary.



Thank you very much!)
 
Chiripaha:

Out of the corner of my eye, I looked at the solutions offered to you earlier by others. You may have permission restrictions when loading templates. This is reflected in the description of ChartApplyTemplate(). But this is only as an option. Or something similar. So when you load via visualization, all permissions are saved, but when programmatically, they are restricted.

Quote from function description:

When you save the template, the rights for the programs running on the graphic are also remembered: the right to trade and the right to use the DLL. For security reasons, these rights may be restricted when the template is applied to the chart:

Trading and DLL usage rights cannot be increased when an EA is launched by applying a template using the ChartApplyTemplate() function.

If the mql4 program which calls ChartApplyTemplate() has no rights to trade, the EA loaded using the template will also have no rights to trade, regardless of the template settings.

If the mql4 program, which calls ChartApplyTemplate(), has trading rights, but the template settings do not, then the EA, loaded by means of a template, will have no trading rights.


I tried to switch them off and on. I changed the template, both with a simple chart with indicators and with an already loaded EA. but the result is the same: in the tester without visualization the EA does nothing, with visualization - everything as planned)) I don't know ... probably the developers should really write or come up with something else without templates.

 

Here's a question:

Suppose we have a full-text search server that has a cache for query results. We need to calculate cache efficiency (maximum cache size and hit percentage) for a given cache time.

Input data

The program enters a text file with the queries received by the server, with the time and the search string, as well as the cache storage time in seconds.

Output data

After its execution the program should output the following values: the number of queries processed, the number of unique queries, maximum cache size (in number of records), probability of getting into cache.



I don't understand what "maximum cache size (in number of records)" means, how to calculate it?

 
Good day gentlemen, I have a very important question, is it possible to configure the robot not to trade at certain times, if so how can it be done?
 
By how much does the standard forex volume indicator increase when the price changes by one tick (by 1 or 2 ???)
 
Mavellol:
Good day gentlemen, I have a very important question, is it possible to configure robot not to trade at certain times, if yes, how can it be done?


I need to implement such a possibility in my Expert Advisor.
 

Hi all!

Please help me with MarketInfo(Symbol(),MODE_MARGINREQUIRED)

double One_Lot =MarketInfo(Symbol(),MODE_MARGINREQUIRED);
the variable One_Lot will contain the value of one lot for the current currency.
Example of lot calculation for EURUSD (Price=1.3606):
standard contract size (1 lot) = 100000
if we buy 100000 EUR we have to pay 100000*1.3606=136060$
we have leverage = 100, so we will pay One_Lot=136060/100=1360.6$

(I understood that all these calculations make MarketInfo(Symbol(),MODE_MARGINREQUIRED) and our One_Lot=1360.6)

but the result is different in the script:

double Price = Ask;
Print ("Price =",Price);

double One_Lot = MarketInfo ( Symb, MODE_MARGINREQUIRED ) ; // the cost of one lot
Print ("One_Lot =",One_Lot);

in the output

17:10:30 inform EURUSD,H1: Price =1.3606

17:10:30 inform EURUSD,H1: One_Lot =1600.0

Where is my mistake?

 
Who is Symb and how do you define it in the code? When calling One_Lot =MarketInfo(Symbol(),MODE_MARGINREQUIRED) directly, it works fine.
 
evillive:
Who is Symb and how do you define it in the code? When calling One_Lot =MarketInfo(Symbol(),MODE_MARGINREQUIRED) works fine.

Thank you for responding!

In my script.

Symb = Symbol ( );

I tried it as you do - the result is the same: One_Lot =1600.0

What is your result?

 
I have it working as it should. leverage 500, the result is 271.38 which gives 271.38*500=135690 quid per lot without leverage.