Orders Execution
It automatically opens orders when conditions are reached
0 Views
0 Downloads
0 Favorites
four4
extern double lot=0.1;
extern int SL=140;
extern int TP=80;
extern int timebuy=16;
extern int timesell=12;
int day, day2;
extern bool buy=true;
extern bool sell=true;
int start()
 {
 
 if (buy==true&&TimeHour(TimeCurrent())==timebuy&&TimeDay(TimeCurrent())!=day)
 {
   

    {
      OrderSend(Symbol(),OP_BUY,lot,NormalizeDouble(Ask,Digits),3,Bid-SL*Point,Ask+TP*Point,"My order #",11111,0,Green);
      day=TimeDay(TimeCurrent());
      
    }
 }
    
    
     
    
 
 if (sell==true&&TimeHour(TimeCurrent())==timesell&&TimeDay(TimeCurrent())!=day2) 
 {
  
      {
        OrderSend(Symbol(),OP_SELL,lot,NormalizeDouble(Bid,Digits),3,Ask+SL*Point,Bid-TP*Point,"My order #",22222,0,Red);
        day2=TimeDay(TimeCurrent());
      }
    } 
 
 
 
 return(0);
 }

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