Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Scripts

Closed Trades to CSV - one row per closing deal (partial closes, reversals) - script pour MetaTrader 5

Vues:
71
Publié:
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance
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.