Calculated data in the indicator buffers getting out of sync with bars of your chart - offline charts

MQL4 指标 C++ SQL

指定

Good day

Please refer to this post (reply from emmzett on 21 March 2024 at 11:12pm

https://www.forexfactory.com/thread/1274095-how-to-refresh-offline-charts-without-restarting-mt4

I need someone to assist me with either option 1 or 2.

Extract from the forum on forexfactory.

(1) First option: You programatically detect in your indicator whether you are running in an online or offline chart. There are various ways to do this. Now when you now that you are in an offline chart, instead of recalculating only the last invalid offset of your indicator buffers (bar 0) you always recalculate all bars. Thus bringing offline file and indicator forcefully in sync with every new tick. The drawback of this option: If you use many bars in your chart or indicator computations are expensive resource-wise, then this will slow down your terminal/charts significantly. Option 1 is the easy option.

(2) Second option: Typically one uses the function IndicatorCounted() or parameter 'prev_calculated' of function OnCalculate() to determine the number of bars to update/recalculate. In offline charts this function doesn't work as expected. It always returns all bars as changed (essentiallly enforcing the solution of option 1). Instead we can emulate the online functionality and if we detect new bars coming in, then we do manually what the terminal would do in an online chart. We shift our indicator buffers with calculated indicator values manually by the number of incoming bars. This shifting can be done in pure MQL but it's slow. I use a DLL function to let C++ do the job for me which is lightning fast. There is one function per buffer type and these functions are part of my MT4Expander which is open-source and available on Github. However, this solution is only suitable for very experienced programmers. In code it looks like in the 3rd screenshot and is part of start() or OnCalculate().


反馈

1
开发者 1
等级
(14)
项目
32
25%
仲裁
3
0% / 33%
逾期
1
3%
工作中
相似订单
can help with my Trading view Pine Script strategy. I have an NT8 Account and am using Trading View Alerts to send signals to NT8. I would like to keep the format i have currently, with TradingView alerts to place the trades via a Webhook i have already established. So i do not want to convert the entire strategy to NT8, but the rather adjust the TV Pinescript to accurately send the alert signals to NT8 who will then
Expert Advisor Needed 150 - 200 USD
I am seeking an experienced MQL5 developer to create a sophisticated trading robot that can generate significant profits across various financial markets, including forex, stocks, cryptocurrencies, commodities, and indices. The goal is to design a robot that can adapt to changing market conditions and capitalize on profitable opportunities. **Key Requirements:** 1. **Strategy:** I am open to any profitable strategy
👋 hey greetings,I'm in need of a developer that can help me with coding a trading bot on MT5 the bot is a combination between 2 indicators that i have on tradingview, that need to be converted to MT5 EA . Kindly bid for the project if it is what you can do for me
We are seeking a skilled developer to decode a MetaTrader 4 Expert Advisor (EA). The ideal candidate should have experience in reverse engineering and a deep understanding of MQL4. The goal is to analyze the existing EA code and provide clear documentation and insights into its functionality. If you have a proven track record of working with MT4 and can deliver high-quality results, we would love to hear from you
I have a code here are slow and legging problem,, this indicator using ex4 as a resource for Statagey I needed to fix this problem,, If you are able to fix it ,, contact me
>Require a Telegram copier software which shall copy trading signal from one telegram group(where I am not an admin, just group member ) to other telegram group under same account or different account(where i am an admin) >Software can transfer the signal from one group to multiple group. > This copier can be kept off to copying signal for certain time as specified as input based on week days. > While copying the
Convert a library to pure MQL5, without using any DLL. The attachment includes the original C++ library CppClient.zip as a MS Visual Studio solution. Ideally it should be written in a way that can be used in both MQL5 and MQL4. I will require full ownership of all the source code also. The library needs to work as per API Reference guide from MQL5 mentioned below. Please let me know if you require further details
A telegram bot that allows users to chat together send pictures and videos and also have crypto payment system for all users more information in DM A telegram bot that allows users to chat together send pictures and videos and also have crypto payment system for all users more information in DM
I have a short tradingview pine script code, And want it convert to mt4, In this indicator, I wont need any visualisation on charts--- Just Buy/sell arrows printed, Make sure the previous buy/sell arrows can also be viewed if I scroll back i will pay $20 for this
Hello,am looking for a great developer, I have already created a bot in .ex4 for mt4 platform, with the logic and everything; it just needs a bit optimization, While compiling the code in MT4, it says no error on the meta trader editor but on the mt4 chart while the bot is running, it is showing it as a sad emoji on the right-hand side of the chart, Could u please check.i will add the file with the code Thanks Ayofe

项目信息

预算
30 - 100 USD

客户

所下订单1
仲裁计数0