ClearTP_ALL

Author: Copyright � 2008, Serega Lykov
ClearTP_ALL
Orders Execution
Checks for the total of open ordersIt can change open orders parameters, due to possible stepping strategy
0 Views
0 Downloads
0 Favorites
ClearTP_ALL
//+------------------------------------------------------------------+
//|                                                  ClearTP_ALL.mq4 |
//|                                   Copyright © 2008, Serega Lykov |
//|                                       http://mtexperts.narod.ru/ |
//+------------------------------------------------------------------+

#property copyright "Copyright © 2008, Serega Lykov"
#property link      "http://mtexperts.narod.ru/"

int start()
  {
   Comment("Script ClearTP_ALL is run...");
   int total = OrdersTotal() - 1;
   for(int i=total; i>=0; i--) if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES) == true) if(OrderTakeProfit() != 0) bool err = OrderModify(OrderTicket(),OrderOpenPrice(),OrderStopLoss(),0,OrderExpiration(),CLR_NONE);
  }

int deinit()
  {
   Comment("");
  }

//+------------------------------------------------------------------+

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