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
작업중
비슷한 주문
So I need an expert pine coder to help me build a tradingview strategy, so am gonna make call with you and discuss all about the project and I got some questions to ask you also, Thank you
Hello, I need someone to manage my prop firm account (long term). You should be experienced with prop firms from before and also demonstrate your previous trading and/or payouts from prop firms. You are free to trade whatever you want as long as it complies with the prop firm rules. My prop firms are FundedNext, FTMO and Instant Funding. I will buy larger and larger accounts as I can afford by the profit you make
I would like an expert to assist in building an indicator and a market analyzer & strategy based on the indicator. Only 2 tools used - 1. MACD and 2. Fib retracement. . It is based on just ONE indicator - SMA cross and close (signal candle), for an entry . The targets will be price levels manually input before 9am EST - which will be on chart. The nearest price line will be the target. Initial stop will be above the
Resolve issues with the position size calculator in an options trading bot to ensure accuracy in contract allocations. Diagnose the existing issues with the position size calculator set to 20% of equity. Adjust and fix the position size calculator to ensure appropriate contract sizes. Test the system to confirm functionality and accuracy of position sizes
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
Hi Everyone, I need a cloud based or wordpress plugin licensing system to protect my MT4 / MT5 Indicators and Expert advisors Secure an unlimited number of EAs and indicators. Create and manage unlimited license keys for secured EAs and indicators with time limits Instantly suspend license keys in case of refund. Create hardware/account number based floating license keys. Set a minimum/maximum account balance limits
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
I have a very simple strategy for XAUUSD on MT4. Here are the details: Rules as follows: BUY – entry price plus 10 pips for TP and minus 10 pips for SL Example: entry price 3052, TP is 3053 and SL is 3051 SELL – entry price minus 10 pips for TP and plus 10 pips for SL Example: entry price 3052, TP is 3051 and SL is 3053 Strategy: 1. Enter market with a BUY trade as per rules above 2. Once trade is closed, if it won
Seeking a skilled PineScript expert for long-term collaboration on TradingView projects. Please let me know your questions and budget. Collaborate on varied PineScript tasks for TradingView -Participate in continuous projects as part of a long-term collaboration. I will send a video link to what my request based on

프로젝트 정보

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