Decorator_Ron_v01

Author: Ron Thompson
Decorator_Ron_v01
Price Data Components
Series array that contains open time of each bar
Orders Execution
Checks for the total of open orders
0 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

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---