Errors, bugs, questions - page 2242

 
darkangel8733:

Hello, I bought an EA from you, "turtle" and it's not working in standalone mode, ???

I'm just saying. If an Expert Advisor uses indicators, even standard ones, it should have access to them. I have already introduced this rule of thumb.

 
A100:
The demand was only one - to help, not hinder. If you think the discussion is unnecessary - do not enter into it... It's not for you to decide (necessary/unnecessary) - that's what the Administration and moderators are for

I agree, but if you do not like advice then you should not respond to it, then there will be no questions... everyone writes here what he thinks is appropriate, I saw fit to give advice, i.e. to provide free help, instead of gratitude I read complaints... Good luck

 
Konstantin:

I agree, but if you don't like the advice, you just don't need to respond to it

Now that's sound advice... thank you for that... I'll take it
 

How so?

ArrayFree(SummArr);
ArrayResize(SummArr,57);
Print("SummArr_1=",SummArr[1]);
2018.07.26 02:09:04.566 Pred_Ocenka_02 (Si Splice,M1)   SummArr_1=1190264832

Why is the value of the array not empty (zero)?

 
Aleksey Vyazmikin:

How so?

Why is the value of the array not empty (zero)?

What if it is sized first and then cleared?

 
Vitaly Muzichenko:

What if it is sized first and then cleared?

Then

2018.07.26 02:20:08.482 Pred_Ocenka_02 (Si Splice,M1)   array out of range in 'Pred_Ocenka_02.mq5' (76,27)
It has no size information after clearing.
 
If
ArrayFree(SummArr);

Remove, then the value is also not empty. The array has not been used before.

 

Some nonsense, here's the code cut in general

int SummArr[];

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   ArrayFree(SummArr);
   ArrayResize(SummArr,57);
   Print("SummArr_1=",SummArr[1]);
   Print("SummArr_30=",SummArr[30]);   
   Print("SummArr_57=",SummArr[56]);   
  }
//+------------------------------------------------------------------+

On the output.

2018.07.26 02:37:58.693 Pred_Ocenka_error (Si Splice,M15)       SummArr_1=1190264832
2018.07.26 02:37:58.693 Pred_Ocenka_error (Si Splice,M15)       SummArr_30=2097181
2018.07.26 02:37:58.693 Pred_Ocenka_error (Si Splice,M15)       SummArr_57=154252694

Please check it out, maybe my terminal's gone crazy.

Or is it normal and everything should be rubbish?

 

The code in mql4 indicator stopped working. how can i fix it?

else{// Иначе стрелка создана. Задаём её свойства
 ObjectSetInteger(Open_name,OBJPROP_ARROWCODE,OpenArrowCode);//код стрелки 232 
 ObjectSet(Open_name,OBJPROP_COLOR,ObjColor);//цвет стрелки
}

Editor says 'ObjectSetInteger' - no one of the overloads can be applied to the function call

It's been working for years and then suddenly stopped. It's a shame, though.


 
Aleksey Vyazmikin:

Some nonsense, here's the code cut in general

On the output.

Please check it out, maybe my terminal's gone crazy.

Or maybe it's normal and everything should be rubbish?

Frees up buffer of any dynamic array and sets size of zero dimension to 0.

When writing scripts and indicators, you may need to use the ArrayFree() function not very often, as all the used memory is immediately released after the script stops operating, and in custom indicators, the main work with arrays is performed by accessing indicator buffers, the sizes of which are automatically managed by the executive subsystem of the terminal.

If you need to manage memory on your own in complex dynamic conditions, the ArrayFree() function will allow you to explicitly and immediately free the memory occupied by a dynamic array that you do not need.

You see? Unnecessary.

Of course, once memory is freed from it, and then you allocate it again by sizing the array, no one will guarantee its contents.

Use array initialization: ArrayInitialize()

Reason: