거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Account Settings Sync - Bidirectional EA Settings Across Charts - MetaTrader 5용 라이브러리

Sayed Ali Ordibehesht
Sayed Ali Ordibehesht
EA PRO TEAM은 트레이더이자 소프트웨어 개발자인 Sayed Ali Ordibehesht가 설립한 독립 트레이딩 소프트웨어 브랜드입니다.
저희는 전문 MetaTrader 5 도구와 트레이더의 생산성을 높이는 솔루션을 개발하며, 리스크 관리, 거래 실행, 자동화 및 거래 성과 분석에 중점을 둡니다.
EA PRO Risk Panel은 정확한 계산, 실계좌에서의 안정성, 효율적인 워크플로 및 깔끔한 사용자 경험을 중심으로 설계된, 지속적으로 확장되는 소프트웨어 생태계의 첫 번째 제품입니다.
조회수:
105
평가:
(2)
게시됨:
\MQL5\Include\AccountSettingsSync\ \MQL5\Experts\AccountSettingsSync\
MQL5.zip (5.83 KB)
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

AccountSettingsSyncDemo on EURUSD,H1 and GBPUSD,H4

AccountSettingsSyncDemo on EURUSD,H1 and GBPUSD,H4 of the same demo account: the same four values at shared revision 18.

Overview

Account Settings Sync is a small MQL5 library for sharing an EA's own runtime settings between charts of the same account. Changes can originate from either chart. It does not modify MQL5 input variables or the platform's Inputs dialog.

The example has exactly four interactive controls: Risk %, Daily loss limit %, Risk alert ON/OFF and Daily alert ON/OFF. These are sample settings only: the package contains no risk engine, drawdown execution, notification delivery or trading commands.

Synchronization

An independent channel and a hash of the broker server and account login identify the shared record. The symbol is excluded. Each operation obtains an exclusive file-handle lock, retrying briefly while another chart holds it. Publishing rereads the latest record, merges only the field being changed, writes and flushes a temporary file, and replaces the shared record with an incremented revision.

This avoids replacing another chart's different-field change with a stale full snapshot. If both charts change the same field, the last successfully saved value wins. Failed operations return false and report an error; an unsuccessful edit must be retried.

The demo polls every 250 milliseconds, without waiting for ticks. This is a timer setting, not a measured latency guarantee. A remote refresh does not replace active or modified local numeric text. Enter commits the edit; MT5 can also end editing when focus leaves the box.

Installation and use

Extract the MQL5 directory from MQL5.zip into the terminal's Data Folder, preserving its subdirectories. Compile MQL5\Experts\AccountSettingsSync\AccountSettingsSyncDemo.mq5. Its relative include resolves to MQL5\Include\AccountSettingsSync\AccountSettingsSync.mqh. No DLL, credentials, network permissions or external package is required.

Attach the demo to two different-symbol charts of the same demo account, using the same InpChannel on both. The default CodeBaseDemo channel and ASS prefix are independent from the original panel. Do not replace an EA that you need to keep running.

For integration, create one CAccountSettingsSync instance, initialize all four ASSSettings.values entries, and call Init(channel, defaults). Publish(field, value) saves one field. Call Sync(changed) from your timer, check its Boolean result, and obtain the committed snapshot with Snapshot(settings, revision). LastError() supplies an error message. The complete initialization and event-handling example is in the demo.

//+------------------------------------------------------------------+
//| Save the runtime risk percentage                                 |
//+------------------------------------------------------------------+
bool SaveRisk(CAccountSettingsSync &store,const double percent)
  {
   return store.Publish(ASS_RISK_PERCENT,percent);
  }

Files

  • AccountSettingsSync.mqh: synchronization library under MQL5\Include\AccountSettingsSync.
  • AccountSettingsSyncDemo.mq5: four-control example under MQL5\Experts\AccountSettingsSync.
  • MQL5.zip: both sources in the intended installation layout.

Storage and limitations

The fixed layout stores two finite percentages from 0 to 100 and two binary switches. The demo accepts up to two decimal places. FILE_COMMON files use ASS.channel.context-hash names, with .bin, .lock and temporary .tmp companions. The lock is held by the open handle, not the mere existence of its filename.

The common folder can be shared by terminal installations in the same Windows environment. Matching server, login and channel can therefore also share settings between those installations; cross-terminal operation has not been tested. Use distinct channels for isolation. There is no remote/VPS synchronization, automatic migration, encryption, schema conversion or power-loss guarantee. Files persist locally; the Global Variable four-week expiry does not apply. Account changes require reinitializing the EA.

Validation status

Tested on one MT5 terminal with a demo account, using EURUSD,H1 and GBPUSD,H4 charts on the same channel. All four controls were changed from each chart and appeared on the other. Two different fields changed from the two charts about 24 ms apart were both kept. Unfinished numeric text on either chart was kept while another program published a different field through the library. Invalid text such as 1.754.4 was rejected without changing the record. Compilation: 0 errors, 0 warnings.

Not tested: several terminals sharing the common folder, different accounts, VPS, crash or power-loss recovery and heavy contention.

Related approaches

External JSON strategy configuration describes another shared EA configuration approach. Storing and exchanging parameters covers file-based exchange. This example focuses on two-way chart editing, a locked per-field merge and preserving unfinished local UI text, not copying trades or synchronizing chart appearance. It makes no claim to have invented shared EA settings.

Why Your Indicator Gives Different Values on Another Broker Why Your Indicator Gives Different Values on Another Broker

Checks the bar history of the chart for six defects that make an indicator give different values on another broker: missing bars, impossible values, filler bars, repeated bars, bars without ticks and price spikes. Every defective bar is marked in the indicator window, and a panel gives a health score for the symbol and timeframe, the largest holes, the defect counts and one line that can be pasted into a comment to compare brokers.

Indicator Doctor: Find Out Why Your MT5 Indicator Shows Nothing on the Chart Indicator Doctor: Find Out Why Your MT5 Indicator Shows Nothing on the Chart

finds out why an indicator shows nothing on the chart. It reads the buffers of every other indicator on the chart and gives each one a verdict: not calculated, all values empty, values only in the newest bars, all values zero, no values in the visible bars, or values outside the visible scale. A panel lists the problems first, gives one line of advice and prints a report line that can be pasted into a comment.

Swing Level Breaks Graded by Volume Swing Level Breaks Graded by Volume

Draws support and resistance from confirmed swing points and keeps each level live, with its price on the chart, until a close breaks it. Every break is graded on the spot: an arrow when volume surges, a diamond when the candle shows a rejection wick, a hollow circle when price slipped through without either.

Tick Depth Probe - how far back your broker keeps real ticks Tick Depth Probe - how far back your broker keeps real ticks

A script that shows how far back your broker's server keeps real ticks for a symbol. It samples a few short windows over the last four years, asks for each one until its ticks arrive or the time is up, and prints the oldest one that has ticks.