Errors, bugs, questions - page 2965

 
fxsaber:

Waiting for this one.

Yes, interesting too, if it's not the files of course, if yes, the above suggested mapping is better

 
fxsaber:

I send ticks from the indicator via this: sparam contains MqlTick, lparam - tick number.

The Expert Advisor catches these ticks in OnChartEvent. And it needs to understand if the current tick is the most actual one or not? I.e., is there a queue of ticks or is it empty?

For this, it reads the number (the task is to read this number) of the latest tick sent by the indicator. If the tick has the same number - the queue is empty, and it's possible to start working with ticks.


And during the operation of OnTick, after OrderSend it's necessary to check if the indicator has sent more ticks. For this, we again need to read the number from the indicator. And there can be more than a hundred of such checks during one OnTick. That's why we need to read it quickly.

I do the check only if not less than milliseconds pass from the previous one. This approach is reasonable and reduces load even more.

 

Can you tell me.

Is it possible to take the lot value from the standard terminal panel? Which is in the upper left corner of the terminal.

Can I programmatically call the menu of an indicator or an Expert Advisor? For example, using the button.

 
fxsaber:

I only do the check if at least a millisecond has elapsed since the previous one. This approach turned out to be reasonable and reduced the load even more.

Maybe I misunderstood, you can bind event id to a symbol and not pass other parameters at all

 
Fast235:

Maybe I misunderstood, you can bind the event id to a symbol and not pass the other parameters at all

Most likely.

 
fxsaber:

Waiting for this one.

Think - the brain has to work. Excuses - I'm not a programmer, etc. - are not accepted. I am a musician myself. I mastered C++ by myself with the help of the book for beginners in 2012.

I think it is even easier for non-programmers, because there are no dogmas and stereotypes. For instance, this"little monster" was 2 times shorter while this supposedly"good but incomprehensible code" was 3 times shorter.

In the meantime, I can give you a solution of your previous problem:

Forum on trading, automated trading systems and strategy testing

Errors, Bugs, Questions

A100, 2020.10.05 20:50

So fast? Not all experts have joined yet... wait a week.

Hint: this works too (but the solution is slightly different)

#define  MACRO(  x, y, z )       enum nn##z { y = x };
#define  MACRO2( x, y )          MACRO( x, y, __LINE__ )
 

Error during execution:

void OnStart()
{
    Print( StringToTime( "ABCDEF" ));
}

Result: 2021.02.19 01:00:00

Expected: Wrong datetime

 
A100:

Error during execution:

Result: 2021.02.19 01:00:00

Expected: wrong datetime

Discussed.

 
A100:

Think - the brain has to work.

Option via SHORTNAME of the indicator is possible.
 
A100:

this"little monster" came out twice as short.

I don't think so.

Reason: