Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
HA-T3_Signal_AO_HA_TL_4H_Bars
//+------------------------------------------------------------------+
//| SRM-TL.mq4 |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 3
#property indicator_color1 Crimson
#property indicator_color2 MediumBlue
#property indicator_color3 Gold
//---- input parameters
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
string TimeFrameStr;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,5,Crimson);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,5, MediumBlue);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,5, Gold);
SetIndexBuffer(2,ExtMapBuffer3);
IndicatorShortName("HAT34H");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
for (int i = 0; i < 2500; i++){
ExtMapBuffer1[i]=0;
ExtMapBuffer2[i]=0;
ExtMapBuffer3[i]=0;
double tlbuy=iCustom(NULL,PERIOD_H4,"TrendLord",50,1,i);
double tlsell=iCustom(NULL,PERIOD_H4,"TrendLord",50,2,i);
// if (iAO(Symbol(), 0, 0) >= iAO(Symbol(), 0, 1)) AoColour = green;
// else AoColour = red;
double aobuy=iAO(Symbol(),PERIOD_H4,i);
double aosell=iAO(Symbol(),PERIOD_H4,i);
double haOpen = iCustom(NULL,PERIOD_H4,"Heiken Ashi",2,i);
double haClose = iCustom(NULL,PERIOD_H4,"Heiken Ashi",3,i);
// double wbuy=iCustom(NULL,0,"W-LNX",14,6,25,true,50,14,34,14,14,6,14,6,14,6,14,6,14,6,14,6,14,6,6,i);
// double wsell=iCustom(NULL,0,"W-LNX",14,6,25,true,50,14,34,14,14,6,14,6,14,6,14,6,14,6,14,6,14,6,7,i);
// if((haOpen<haClose && (tlbuy>0 && tlsell==EMPTY_VALUE) && wbuy!=EMPTY_VALUE)) ExtMapBuffer2[i] = 1;
if((haOpen<haClose && (aobuy > 0) && (tlbuy > 0 && tlsell==EMPTY_VALUE))) ExtMapBuffer2[i] = 1;
// if((haOpen>haClose && (tlbuy==EMPTY_VALUE && tlsell>0)&& wsell!=EMPTY_VALUE ))ExtMapBuffer1[i] = 1;
if((haOpen>haClose && (aosell < 0)&& (tlsell > 0 && tlbuy==EMPTY_VALUE)))ExtMapBuffer1[i] = 1;
if (ExtMapBuffer2[i]==0 && ExtMapBuffer1[i]==0) ExtMapBuffer3[i]=1;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments
Markdown Formatting Guide
# H1
## H2
### H3
**bold text**
*italicized text*
[title](https://www.example.com)

`code`
```
code block
```
> blockquote
- Item 1
- Item 2
1. First item
2. Second item
---