Download MetaTrader 5

Long Time Calculation Problems.

To add comments, please log in or register
Shin Joo Young
379
Shin Joo Young  

I have an indicator source that needs long calculation time more than 100 seconds.

The indicator takes too long time to calculate it and chart stops while the indicator calculate.

Any body has solutions about this?

whroeder1
15722
whroeder1  
  1. Don't calculate every bar. Fix the indicator.
  2. Lower max bar1 on chart to a small number (1000)
Shin Joo Young
379
Shin Joo Young  
WHRoeder:
  1. Don't calculate every bar. Fix the indicator.
  2. Lower max bar1 on chart to a small number (1000)

No, this indicator needs many calculation.

I need function that can get ticks while calculation.

whroeder1
15722
whroeder1  
tlswn128: No, this indicator needs many calculation. I need function that can get ticks while calculation.
  1. Indicators can NOT wait - they MUST return quickly per tick. There is NO function to get ticks while the calculation is being done.
  2. The calculation must be rewritten to do a little, save it's state, return to get the next tick and resume the calculation, repeat.
  3. Otherwise the calculation must be done in a EA.
SYED NAUFAL GADDAFI
1399
SYED NAUFAL GADDAFI  
Just split the indicator. One do the calculation and another get the ticks. Use GV so that it can communicate with each other. Done.
Halley
198
Halley  
tlswn128:

No, this indicator needs many calculation.

I need function that can get ticks while calculation.

You may give a try to convert the indicator into EA (or script). It will use additional thread giving the main thread some air to update.
whroeder1
15722
whroeder1  
deysmacro: Just split the indicator. One do the calculation and another get the ticks. Use GV so that it can communicate with each other. Done.
Won't help. While the one indicator is doing the calculation - nothing else in the terminal runs. Indicators must return quickly.
The Sleep() function can't be called for custom indicators, because indicators are executed in the interface thread and must not slow down it.
To add comments, please log in or register