Decorator_Ron_v01

Download script
Author: Ron Thompson
Decorator_Ron_v01

This script is designed to enhance the visual clarity of your trading platform by automatically labeling active trades on your chart. Instead of requiring you to manually identify which trade corresponds to which position, the tool provides a real-time visual guide directly on the price action.

How it Works:

The logic follows a continuous cycle that scans your open trading accounts and performs the following actions:

  • Automatic Detection: The script constantly monitors all currently active orders. It specifically filters these to identify trades belonging to the specific currency pair or asset you are currently viewing on your screen.
  • Visual Labeling: Once an active trade is detected, the tool identifies whether it is a "Buy" or a "Sell" position.
  • Dynamic Placement: It automatically places a text label on the chart at the exact price point where the trade was opened. To ensure the label is easy to read and doesn't clutter the entry price itself, it offsets the text slightly above the entry level.
  • Clear Identification:
    • For Buy positions, it places a white "B" on the chart.
    • For Sell positions, it places a white "S" on the chart.
  • Real-Time Updates: The script is designed to refresh this information constantly. If you open new trades or if the order status changes, the script updates the labels to ensure they accurately reflect your current portfolio.

In short, this tool acts as an automated visual assistant, making it much easier to manage multiple positions at a glance by clearly marking your entries with simple, recognizable letters.

Price Data Components
Series array that contains open time of each bar
Orders Execution
Checks for the total of open orders
15 Views
0 Downloads
0 Favorites
Decorator_Ron_v01
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+--------------------------------+
//|                                |
//+--------------------------------+
#property copyright "Ron Thompson"
#property link      "http://www.lightpatch.com/forex/"

//+-------------------------------------------+
//|                                           |
//+-------------------------------------------+
int start()
  {   
   int cnt;
   
   for(cnt=OrdersTotal();cnt>=0;cnt--)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if( OrderSymbol()==Symbol())
        {
         if(OrderType()==OP_BUY)
           {
            ObjectDelete("Objt"+DoubleToStr(cnt,0) );
            ObjectCreate("Objt"+DoubleToStr(cnt,0), OBJ_TEXT, 0, Time[OrderOpenTime()], OrderOpenPrice()+(10*Point()) );
            ObjectSetText("Objt"+DoubleToStr(cnt,0),"B",10,"Arial",White);
           }
         if(OrderType()==OP_SELL)
           {
            ObjectCreate("Objt"+DoubleToStr(cnt,0), OBJ_TEXT, 0, Time[OrderOpenTime()], OrderOpenPrice()+(10*Point()) );
            ObjectSetText("Objt"+DoubleToStr(cnt,0),"S",10,"Arial",White);
           }
        }//if
     
     }//for
  
  }//start

Comments