Orders Execution
0
Views
0
Downloads
0
Favorites
SetStopLoss
extern int StopLoss=50;
int start()
{
for(int cnt=OrdersTotal();cnt>=0;cnt--)
{
if(OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES)==true)
{
if(OrderType()==OP_BUY && OrderStopLoss()==0)
{
OrderModify(OrderTicket(),0,OrderOpenPrice()-StopLoss*Point,OrderTakeProfit(),0,CLR_NONE);
}
if(OrderType()==OP_SELL && OrderStopLoss()==0)
{
OrderModify(OrderTicket(),0,OrderOpenPrice()+StopLoss*Point,OrderTakeProfit(),0,CLR_NONE);
}
}
}
}
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---