ShowHistoryOnChart-V1.1
This EA reads trade history from a CSV file and visually displays it on the chart using colored arrows for buy/sell open and close points, connected by dotted trendlines. It does not execute any trades itself; it is purely a visualization tool for reviewing past trading activity.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
This EA is not a trading strategy program but a trade history visualization tool. During OnInit(), it reads a user-specified CSV file from the MQL5/Files directory, parsing each trade's open time, direction, volume, symbol, open price, close time, close price, commission, swap, and profit fields. Buy trades are marked with blue arrows and trendlines; sell trades are marked with red arrows and trendlines. The open point is indicated with a buy/sell arrow object, the close point with the opposite arrow, and a dotted trendline connects both to visually display each trade's entry and exit trajectory. Position sizing and money management are entirely absent since this tool does not perform any trading operations.
Strengths
- Intuitive visualization of trade history, making it easy to review and analyze trading performance
- Color-coded buy/sell directions with arrow and trendline combination clearly shows entry and exit points
- Simple and lightweight implementation, consuming no runtime resources (executes only once during initialization)
Weaknesses
- Global variables clr, objectArrowOpen etc. are declared outside functions, risking state conflicts with multiple instances or re-initialization
- Fragile CSV parsing: StringSubstr hardcodes price truncation to 7 characters, causing errors for symbols with different price precision
- FileReadString(handle,4) to skip 4 columns is unreliable; any slight CSV format change causes parsing misalignment
- No error handling: when the file doesn't exist or has format errors, there is no user notification — it silently fails
- OnDeinit's ObjectsDeleteAll is overly aggressive, removing all chart objects including those from other EAs or manual additions
Possible improvements
- Move global variables to local scope within OnInit, and add symbol prefix to object names to avoid naming conflicts
- Replace StringSubstr hard-coded truncation with proper string-to-double conversion, and add CSV format validation with error prompts
- In OnDeinit, only delete objects created by this EA using a unified naming prefix instead of deleting all chart objects
Risk assessment
Overall risk: Safe
- ObjectsDeleteAll removes all chart objects including those from other indicators or manual drawings, causing accidental data loss
- Global variable state may cause race conditions on re-initialization, though impact is limited for a non-trading utility
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
fileName | "" | CSV filename in MQL5/Files, semicolon-delimited |
Similar Utility EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.