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
등급
(15)
프로젝트
33
24%
중재
3
0% / 33%
기한 초과
1
3%
작업중
2
개발자 2
등급
프로젝트
0
0%
중재
0
기한 초과
0
작업중
비슷한 주문
Hello I need exactly that! Already have a mt5 strategy…. I need to convert the same to ninja and TradeLocker let me know price timing and what you need Let me know if you can work on this Kindly Hi me On Tgram - Drealfx51
Hi. I have the statement of the Ea live results that I want to have. Please check this video from YouTube and the statement to see how the robot is working every day. I want a robot like this or better. The robot has 1-4% drawdown and 300-500% profit per month The robot works with ICMarkets Global 1:500 leverage and FPMarkets. The robot works between 10-30 minutes London session. Also the Robot can start trading from
Indicator List : - Single Moving Average Time Management Folder : - Trade By Days ( Monday - Sunday ) True/False or On/Off . - Move Trade by session Input parameters in this folder . Additional Parameters to be added to the Panel : T1 P = ATR V, Nil T5 P = ATR V, Nil T2 P = ATR V
I have a robot that should work on De40 but has some error and I'm looking for someone to fix it. The problem is the robot doesn't open trades. The robot should work on De40 M5 London S like in the video https://youtu.be/p2JyHXfdeS0?si=Ibzi3tFgvf0msWDZ please let me know if you can help and I can provide more details
We are looking for a developer to build a system that includes FIX protocol integration, real-time order flow imbalance analysis, and comprehensive trade management functionalities. Interested candidates should contact us for a detailed project description."
Hello, The days of hiring people to trade on my prop firm accounts are gone for good, fail after fail, nobody can really manage it.. and between, it's also against the terms. So, I think that hiring somone instead to build an ea that can pass/trade on my prop firms account are a much better solution. So that is what this job is about. I need you to give me or build a super-duper safe ea (bot) that can pass and/or
Grid EA 50 - 300 USD
### **No-SL Strategy for XAU/USD (Gold)** **Objective**: Profit from 1-pip scalps using buy/sell stop orders while hedging risk through opposing trades. **Conditions**: - Broker allows **hedging** (simultaneous buy/sell orders). - Zero spreads/commissions (as per your setup). --- ### **Rules** #### **1. Entry Logic** - Place **buy stops** 1 pip above the current price and **sell stops** 1 pip below. - Deploy a
If you are from nigeria or you are nigerian, please i beg you dont message me on this project, thank you, Develop an Expert Advisor for MetaTrader 4 focused on automating the Break and Retest trading strategy with efficiency and a high win rate - Monitor key market levels between 9:30 a.m. and 9:35 am. Detect and confirm breakouts with candle close beyond initial levels, entering trades on a validating retest. Set a
Control Panel 30 - 40 USD
Hello, I need a dashboard with 4 tabs. The first tab should have buy, sell, lot, trailing, and fields for TP and SL. I want a simple, uncomplicated panel. The second tab should have symbol statistics. That's all. Please show examples that you've already done something similar. I just want the source code example since I will modify it myself. Please, if you don't have experience, don't write
Hi all, I would like to have tradingview(pinescript) MACD converted to MT4(MQL4). The main purpose is to have 2 colours for each direction of the bar like in TradingView. 1 light green, 1 dark green and 1 light red, 1 dark red kind regards

프로젝트 정보

예산
30 - 100 USD
개발자에게
27 - 90 USD