TradeHedgeDISPLAY_v2

TradeHedgeDISPLAY_v2
Orders Execution
Checks for the total of open orders
2 Views
0 Downloads
0 Favorites
TradeHedgeDISPLAY_v2
//
// TradeHedge profit display
//

#property indicator_chart_window

datetime bartime;
int      obj;

int start() 
  { 

   if(bartime!=Time[0] ) 
     {
      bartime=Time[0];
      obj++;
     }

	int i;
	double myProfit=0;
	
	for(i = OrdersTotal(); i>=0; i--)
     {
      OrderSelect(i, SELECT_BY_POS);
      if(OrderMagicNumber()==200809241653)
        {
         myProfit=myProfit+OrderProfit();
        }

	  }

   ObjectDelete("myp"+DoubleToStr(obj,0));
   ObjectCreate("myp"+DoubleToStr(obj,0), OBJ_TEXT, 0, Time[0], High[0]+(5*Point));
   ObjectSetText("myp"+DoubleToStr(obj,0),DoubleToStr(myProfit,2),10,"Times New Roman", White);
  } 


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 ---