Basket Viewer - View statistics for long and short pairs - MetaTrader 4 Script - MT4/MT5 Resources


This utility allows monitoring of multiple symbols and positions on one chart, with one group for long (buy) symbols and another for short (sell) symbols. There are 7 default symbol pairs in each group. Users can change these and enter up to 50 Market Watch symbols in the long or short basket for viewing.
Click on a symbol to change the currently displayed chart to any symbol in the indicator display. Displays statistics including ATR for the chart period, points gained or lost since the start of the week, position gains or losses, and lot exposure. Statistical weeks can be changed with a simple click on the display, and the display can be dragged and dropped to a different location. Simply publishing an event that starts display update processing, rather than running the update inline with quote processing, keeps the load on quote processing low.
Below is a description of the display's main controls and functions - the first two lines have "Control Objects" (full image below):

"Basket Viewers (Week 0): 2019.05.19 - 2019.05.26"
Click the Basket Viewer to select the object and drag the panel to another location on the diagram.
Click on the first date (2019.05.19) to increase the number of weeks displayed.
Click on the second date (2019.05.26) to reduce the number of weeks displayed.
"Buy basket points Bskt_ATR Pos_Prft Pos_lots"
Click this line to highlight the currently selected week on the chart (draw a rectangle over it). Click a second time to delete the rectangle.
A "buy basket" is a list of pairs drawn from a user-controllable "buy pair string". Clicking on each "String Pair" changes the diagram to that symbol.
"Points" are the week's opening price minus the week's closing price (closing price - opening price). This is based on the week selected (defaults to week 0, the current week).
"Bskt_ATR" is the atr of the symbol for the week within the chart time frame. This is based on the week selected (defaults to week 0, the current week).
"Pos_Prft" is the profit or loss from any active trade on the ticker. In the picture, GBPJPY has a profit of $150.07. This does not change based on the week selected.
"Pos_Lots" is the exposure for the specified symbol. The chart shows 1 lot exposure of GBPJPY. This does not change based on the week selected.
As shown in the image below, this header is followed by buy pair statistics, including totals for the Points, ATR, Prft, and Lot columns.
"SELL_BASLET Points Bskt_ATR Pos_Prft Pos_Lots"
This is a duplicate of the "Buy Basket" title of "Sell Currency Pair String". There is no event action for clicking this display row. As shown in the image below, this title is followed by sell pair statistics, including totals for the "Points", "ATR", "Prft" and "Lots" columns. Totals are the opposite of buy baskets - for example, profit points for the week are (opening price - current/closing prices), while profit points for a buy basket are (current/closing prices - open prices).

Attachment download
📎 basket_viewer.mq4 (74.8 KB)
Source: MQL5 #25649
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •