Orders Execution
1
Views
0
Downloads
0
Favorites
Break 1mn[1]modified
//+------------------------------------------------------------------+
//| neroTrade.mq4 |
//| Copyright © 2008 Gryb Alexander |
//| last modified: 19 november 2008. Totom (totom@nsk.com) |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008 Gryb Alexander"
#property link ""
extern double TP = 15;
extern double SL = 15; //add this (stoploss value)
extern double lots = 1;
int slippage = 3;
datetime curTime;
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//----
// if((Time[0]!=curTime))
// {
// curTime=Time[0];
if(OrdersTotal()==0)
{
if(Close[0]>High[1]) OrderSend(Symbol(),OP_BUY,lots,Ask,slippage,Ask-SL*Point,Ask+TP*Point,NULL,123,0,Red); //add SL in order send function
if(Close[0]<Low[1]) OrderSend(Symbol(),OP_SELL,lots,Bid,slippage,Bid+SL*Point,Bid-TP*Point,NULL, 123,0,Blue); //add SL in ordersend function and fix code of TP
}
//----
return(0);
}
//+------------------------------------------------------------------+
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
---