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

Closed Trades to CSV - one row per closing deal (partial closes, reversals) - MetaTrader 5용 스크립트

조회수:
308
게시됨:
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
Exports the closed trades of the account to a CSV file, one row per closing deal.

Why one row per closing deal: a partial close gets its own row with the closed volume. Close-by and netting reversals (one deal that closes a position and opens the opposite one) are split correctly. Each row carries the open time of the position and the volume-weighted open price of the volume that was still open. The entry commission is shared out by closed volume, so profit + commission + swap of all rows adds up to the account result.

Columns: symbol, side, open_time, close_time, volume, open_price, close_price, profit, commission, swap, magic, position_id, duration_sec

Inputs:
From / To: close time range (0 = all history / now). Positions opened before "From" are still exported when they close inside the range.
Symbol: empty = all symbols.
Magic number: -1 = all, 0 = manual trades. The magic is the one of the opening deal.
File name, and an option to save in the common Files folder.

Times are broker server time with seconds (yyyy.mm.dd hh:mm:ss). Money values are in the account currency. Read only: the script does not trade.

Close-by: MetaTrader books the whole profit on one of the two closing deals, so one row shows the profit and the other shows 0.

Tested in the Strategy Tester on a netting account (adding to a position, partial close, reversal) and on a hedging account (partial close, close-by), with magic / symbol / date filters: the exported rows add up to the balance change to the cent.

Codebase

XAUUSD Hourly Volatility Clock: typical range by hour vs today XAUUSD Hourly Volatility Clock: typical range by hour vs today

A 24-hour clock of typical H1 ranges for XAUUSD (and any other symbol) versus the range of the current hour. The profile uses closed hours only. Display only — it does not trade.

Gold Level Map (XAUUSD): Round Numbers, Prior Day/Week Extremes and ADR Gold Level Map (XAUUSD): Round Numbers, Prior Day/Week Extremes and ADR

A clean on-chart map of psychological 00/50 figures, prior day and week extremes, and the average daily range, with honest bounce/break statistics. Display only — it does not trade.

Risk Lot Calculator - lot size from risk percent and stop distance Risk Lot Calculator - lot size from risk percent and stop distance

Small include file that gives you the lot size from risk in percent (or fixed money) and the stop loss distance. Rounds always down, checks min/max lot and free margin.

Auto Fibonacci Retracement on the Latest Swing Auto Fibonacci Retracement on the Latest Swing

Detects swing highs and lows automatically and draws Fibonacci retracement levels on the latest completed swing leg. The levels move to the new leg as soon as a new swing is confirmed; the levels, their colors and the swing sensitivity are configurable.