
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks for sharing the solution.
To be honest, this is not exactly a true solution. Indicators need new ticks to update, and MTF indicators depend on a new tick. Closed market = no new ticks
It is a limitation that we have to live with because it's based on how the MT5 software worksTo be honest, this is not exactly a true solution.
As a freelancer you have to keep your customer satisfied anyway.
or you could just remind the customer that trading is only possible on a live market, not on a closed market :') next the customer will ask you do to a MACD plot on the chart window
Hi,
I have this sample code for the MTF RSI indicator.
The first thing we check in onCalculate is whether the number of bars calculated by the RSI handle matches the number of bars in the selected timeframe. If they don’t match, the function returns zero. This works well in the open market, and after a few ticks, we eventually calculate the RSI values.
However, in a closed market, onCalculate only runs once and does not calculate the historical values of the RSI.
Does anyone have a solution for this problem so that it works well in a closed market too?Hi Mohsen
Create a class to access data using Timeseries access. Then you don’t need to use OnCalculate to receive market data. Use that class to feed your indicator calculation logic, and call your logic in OnInit().