Author: Copyright � 2007, MetaQuotes Software Corp.
BSI1
Miscellaneous
Implements a curve of type %1
0 Views
0 Downloads
0 Favorites
BSI1
//+------------------------------------------------------------------+
//|                                                          BSI.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Yellow
#property indicator_color2 Lime
#property indicator_color3 DeepPink
#property indicator_color4 Blue
#property indicator_width4 5
#property indicator_color5 Red
#property indicator_width5 5
#property indicator_level1 50

//---- buffers
double BUY[];
double SELL[];
double GBPUSD[];
double EURUSD[];
double USDCHF[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,GBPUSD);

   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,EURUSD);

   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,USDCHF);

   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,BUY);

   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,SELL);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i, j, counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars;
   while(i>=0)
   {
     GBPUSD[i]=iCustom("GBPUSD",0,"JRSX",3,0,i);
     EURUSD[i]=iCustom("EURUSD",0,"JRSX",3,0,i);
     USDCHF[i]=iCustom("USDCHF",0,"JRSX",3,0,i);
     int GU_Trig=1,EU_Trig=1,UC_Trig=1,vTrig;
     if(GBPUSD[i]<50)GU_Trig=-1;
     if(EURUSD[i]<50)EU_Trig=-1;
     if(USDCHF[i]<50)UC_Trig=-1;
     vTrig=GU_Trig+EU_Trig-UC_Trig;
     if(vTrig>2)
     {
       BUY[i]=50;
       SELL[i]=EMPTY_VALUE;
     } else 
     if(vTrig<-2)
     {
       BUY[i]=EMPTY_VALUE;
       SELL[i]=50;
     }
     else 
     {
       BUY[i]=EMPTY_VALUE;
       SELL[i]=EMPTY_VALUE;
     }
     i--;
   }
   
//----
   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 ---