ControlPoints

Author: Joke by primajaya
Price Data Components
Series array that contains open prices of each bar
Orders Execution
Checks for the total of open ordersIt automatically opens orders when conditions are reached
1 Views
0 Downloads
0 Favorites
ControlPoints
//+------------------------------------------------------------------+
//|                                                ControlPoints.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Joke by primajaya"
#property link      "Control Points is a Joke"

extern int TP = 100;
extern int SL = 50; 

#define magic 8888 // very lucky right?
#define risk 10 // 10% enough

//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
double op = iOpen(Symbol(),1440,0);
double lot = NormalizeDouble(AccountEquity()*risk/100000,1);

if(OrdersTotal()<1)
{
   if(Ask<op) OrderSend(Symbol(),OP_BUY,lot,Ask,2,Ask-SL*Point,Ask+TP*Point,"Control Points",magic,0,Red);
   if(Bid>op) OrderSend(Symbol(),OP_SELL,lot,Bid,2,Bid+SL*Point,Bid-TP*Point,"Control Points",magic,0,Blue); 
}

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