Long Time Calculation Problems.

 

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?

 
  1. Don't calculate every bar. Fix the indicator.
  2. Lower max bar1 on chart to a small number (1000)
 
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.

 
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.
 
Just split the indicator. One do the calculation and another get the ticks. Use GV so that it can communicate with each other. Done.
 
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.
 
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.
Reason: