Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 136

 
Alekseu Fedotov:


Get in the habit of putting curly braces immediately with the condition

if(Condition)

{

}

A for your question like this

if(Условие1)
   {
       if(Условие2)

        {

        }
    }
   else

    {

    }


Thank you very much!!!

 
Vitaly Muzichenko:

There's a customisable fractal feature, well geez, that's awfully heavy. I've left the drawing of objects only to visually show if the fractals are forming correctly - it's not going to happen.

Question: how can I make it easier, because visual testing is getting slow

The easiest way to speed up visual testing - minimize window during visualization - speed up by an order of magnitude :) But in this case you cannot look at the redrawing indicators... - You just have to mark the important changes in them.

 
Alexey Viktorov:
The only way to make it easier is to convert it all to an indicator. Even the comment in the upper left corner of the chart and especially the position opening and closing marks, which the tester itself puts, are slowing down the testing.

That's the point, it doesn't need to be in an indicator, it needs to be a function in an EA.

The question is relevant!

 
Vitaly Muzichenko:

That's the point, it doesn't need to be in an indicator, it needs to be a function in an EA.

The question is relevant!

What's the problem? Then attach the indicator to the resource and there's no problem...

Well, as a last resort, refuse from drawing and just write the last data you need in a custom array or even in an array of structures.

 
Alexey Viktorov:

What's the problem? Then attach the indicator with a resource and no problem...

Well, as a last resort, don't do any drawing and just write the last data you need in a custom array or even in an array of structures.

There won't be any drawing)

The search logic itself is heavy there, and how to make it easier - I don't know yet

 
Vitaly Muzichenko:

There won't be any painting)

The search logic itself is heavy, and how to make it easier - I don't know yet


It is possible to roll in an indicator without drawing). Or better yet, you can make a choice. Hop - drawing, hop - no drawing:)
 
Alexey Kozitsyn:

You can roll it into an indicator without drawing). Or better yet, make a selection. Hop - drawing, hop - no drawing :)

Yo, I don't need any drawing at all, I need the bar number where the fractal was formed [last and penultimate] - ALL :)

I don't need indicator for that purpose. The sampling itself is complicated in the code, so how can we make it easier?

 
Vitaly Muzichenko:

Yo, I don't need drawing at all, I need the bar number where the fractal was formed [last and penultimate] - ALL :)

I don't need indicator for that purpose. The sampling itself is complicated in the code, so how can we make it easier?

Calm down, only calm down! Another argument in favour of the indicator: all necessary data arrays are already prepared, on every tick. You can more easily define what you need.

How to make it easier? Start by running the profiler.

 
Alexey Kozitsyn:

Calm, only calm! Another argument in favour of the indicator: all the necessary data sets are already prepared, on every tick. You can identify what you need more easily.

How to make it easier? Start by running the profiler.

Thanks, but I'm not quite there yet(

I was taught by Vladimir a couple of days ago how to use tester, and you're talking about the profiler =)

 

Hi everyone! How do I write my condition! I need to put a stop-loss order after the price has passed the stop-loss distance

for Buy.....

if( )

{

------------

}

for Sell.....

Reason: