Indicators Used
Ichimoku Kinko Hyo
0 Views
0 Downloads
0 Favorites
ICHI_OSC
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 White

//---- input parameters
//---- buffers
extern int a_ichi=22;
int ts,ks,sb;

double    

mode_ts,
mode_ks,
mode_sb,
mode_sa,
mode_cs,
trend,
markt;

double way[];
//----
int a_begin;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//----
   SetIndexStyle (0,DRAW_HISTOGRAM,STYLE_SOLID,2);
   SetIndexBuffer(0,way);
   //SetIndexShift(0,1);   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Ichimoku Kinko Hyo                                               |
//+------------------------------------------------------------------+
int start()
  {
        ts=a_ichi*0.5;
        ks=a_ichi*1.5;
        sb=a_ichi*3.0;
         
        int counted_bars=IndicatorCounted();
         if(counted_bars>0) counted_bars--;
         int limit=Bars-counted_bars;
         for(int i=0; i<limit; i++)
         {
         mode_ts = iIchimoku(NULL,0,ts,ks,sb,MODE_TENKANSEN,i);
         mode_ks = iIchimoku(NULL,0,ts,ks,sb,MODE_KIJUNSEN,i);
         mode_sb = iIchimoku(NULL,0,ts,ks,sb,MODE_SENKOUSPANB,i-ks);
         mode_sa = iIchimoku(NULL,0,ts,ks,sb,MODE_SENKOUSPANA,i-ks);
         mode_cs = iIchimoku(NULL,0,ts,ks,sb,MODE_CHINKOUSPAN,i+ks);
         
         markt=(mode_cs-mode_sa);
         trend=(mode_ts-mode_ks);         
         
         way[i]=-(trend-markt)/Point;
         }
         IndicatorDigits(0);
   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 ---