IndicatorRelease WHEN needed? - page 2

 
Baumann Andrea:

Nice to read u again.

Thanks, but sorry I don't remember you 
 
Enrique Dangeroux:

...

I use the eventsspy indicator, which is does not really indicate anything but allows to pass events, i am interested in tick's only. So my first method was to create the indicator handle only when entering a trade, because no trade, no ticks needed. Similar to Andreas approach.

Now considering my EA loads 28 charts without doing anything it is a relative memory hog per definition. IndicatorRelease() does not work in tester, so it can not be tested. The continues creation and releasing was giving me the same worries as Andreas. 

Ok so yes that's a good situation to use IndicatorRelease(). If it's beneficial or not depends about your EA.

 
Alain Verleyen:

Ok so yes that's a good situation to use IndicatorRelease(). If it's beneficial or not depends about your EA.

For me it was to avoid the indicator to trigger the event for ticks i do not need. The event queue gets messed up when there is large tick volumes in short time span. IE my logic gets triggered on ticks not needed and not triggered on ticks i need on a frequent bases, essentially rendering it useless.

I still think it is the best solution to eliminate the (any) indicator if you do not use it. If alone for the sake of resources. However it does not work in tester (though it should, everyone will vote for faster back tests and or optimization).

I have since worked around this problem by managing the indicator status through global vars. The indicator is still loaded and running on all charts, all the time, but switched on or of when needed.

Still not ideal, it is the best solution i have found for multi currency/asset EA working on tick basis only, not using some timer construction to get the ticks.

Somehow i cant kick the feeling MT1234 was created with simple one pair trading in mind and MT5 did not change any in this regard.

 
Enrique Dangeroux:

For me it was to avoid the indicator to trigger the event for ticks i do not need. The event queue gets messed up when there is large tick volumes in short time span. IE my logic gets triggered on ticks not needed and not triggered on ticks i need on a frequent bases, essentially rendering it useless.

I still think it is the best solution to eliminate the (any) indicator if you do not use it. If alone for the sake of resources. However it does not work in tester (though it should, everyone will vote for faster back tests and or optimization).

I have since worked around this problem by managing the indicator status through global vars. The indicator is still loaded and running on all charts, all the time, but switched on or of when needed.

I see. Yes fortunately Metaquotes gives us some home work :-D

Still not ideal, it is the best solution i have found for multi currency/asset EA working on tick basis only, not using some timer construction to get the ticks.

And why not a timer ? 

Somehow i cant kick the feeling MT1234 was created with simple one pair trading in mind and MT5 did not change any in this regard.

Metaquotes is working on a new kind of program : Services. They will run independently of any chart, and you will be able to subscribe to tick event for all the symbols you want. However as the post I quoted is already almost 1 year old, I have no idea when it will be available.
 
Alain Verleyen:
And why not a timer ?

IMO one needs right tool for the right job, timer feels like using hammer to screw in a screw.

The Services does looks promising. I will wait patiently.

 
Enrique Dangeroux:

IMO one needs right tool for the right job, timer feels like using hammer to screw in a screw.

Well, not sure why you think that, but could be worth to check it one day.  

The Services does looks promising. I will wait patiently.

Hopefully soon, will be very interesting.

 
Sorry Guys this is going to far for my understanding

Will a later reload of the same indicator use the same memory  Yes/No ?

Can i delete and ad it 20000 times without killing memory with buffers Yes/No ?

THNX ;-)  (@ Alain: dnt worry it was a year ago, cool to have u here ur a GURU ;-))
 

Baumann Andrea:
Sorry Guys this is going to far for my understanding

Will a later reload of the same indicator use the same memory  Yes/No ?

Can i delete and ad it 20000 times without killing memory with buffers Yes/No ?

Answer to both questions is : it depends.

Even using IndicatorRelease(), after a "while" if the indicator is not used (elsewhere), it will be completely removed from memory. We don't have information about this "while" (AFAIK).

So 2 possibilities :

1° Either you "reload" AFTER the indicator has been "completely removed from memory", then all will be recalculated.

2° You "reload" BEFORE, you will get an handle to the same indicator already in memory.

THNX ;-)  (@ Alain: dnt worry it was a year ago, cool to have u here ur a GURU ;-))

Welcome.
Reason: