Download MetaTrader 5
To add comments, please log in or register
Have you made a screenshot in MetaTrader? Share it with friends!
Shin Joo Young
280
Shin Joo Young 2014.09.21 14:13 

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
13593
whroeder1 2014.09.21 16:12  
  1. Don't calculate every bar. Fix the indicator.
  2. Lower max bar1 on chart to a small number (1000)
Shin Joo Young
280
Shin Joo Young 2014.09.21 17:20  
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
13593
whroeder1 2014.09.22 12:24  
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
1401
SYED NAUFAL GADDAFI 2014.09.22 12:29  
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 2014.09.22 14:33  
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
13593
whroeder1 2014.09.22 19:15  
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