Author: FORTRADER.RU
Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest 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
VLT_TRADER
//+------------------------------------------------------------------+
//|                                                   VLT_TRADER.mq4 |
//|                                                     FORTRADER.RU |
//|                                          http://www.fortrader.ru |
//+------------------------------------------------------------------+
#property copyright "FORTRADER.RU"
#property link      "http://www.fortrader.ru"

extern int profit = 10;
extern int stop = 10;
double BUYLIMIT,SELLLIMIT,bar,sup,sup1;
int okbuy,oksell,onepossell,oneposbuy,i;
double value=100;

int start()
  {
  double VLT,VSE,ULTRA;

  
  
  VLT=MathAbs(iHigh(NULL,0,1)-iLow(NULL,0,1));

  
  for(int i=2;i<10;i++)
  {
  
  if (MathAbs(iHigh(NULL,0,i)-iLow(NULL,0,i))<value && MathAbs(iHigh(NULL,0,i)-iLow(NULL,0,i))>0){value=MathAbs(iHigh(NULL,0,i)-iLow(NULL,0,i));}
  }  
  
  
  okbuy=0;oksell=0;
  for(int cnt=0;cnt<OrdersTotal();cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
       
         if(OrderType()==OP_BUY || OrderType()==OP_BUYSTOP)
         {
         okbuy=1;
         }
        
         if(OrderType()==OP_SELL || OrderType()==OP_SELLSTOP)
         {
         oksell=1;
         }
      }
    
  

  if(VLT<value && okbuy==0)
  {
  double OpenPrice=High[1]+10*Point;
  double Profit=OpenPrice+profit*Point;
  double Stop=OpenPrice-stop*Point;
  OrderSend(Symbol(),OP_BUYSTOP,0.1,OpenPrice,3,Stop,Profit,"My order #",16384,0,Green);
  okbuy=1;
  }
  
      if(VLT<value && oksell==0)
  {
   OpenPrice=Low[1]-10*Point;
   Profit=OpenPrice-profit*Point;
   Stop=OpenPrice+stop*Point;
  OrderSend(Symbol(),OP_SELLSTOP,0.1,OpenPrice,3,Stop,Profit,"My order #",16384,0,Green);
  oksell=1;
  }


 

  
value=100;
   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 ---