Miscellaneous
0
Views
0
Downloads
0
Favorites
Stomach_exit_v1
//+------------------------------------------------------------------+
//| Fisher_exit.mq4 |
//| Kalenzo |
//| simone@konto.pl |
//+------------------------------------------------------------------+
#property copyright "Kalenzo"
#property link "simone@konto.pl"
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
extern int KPeriod=10;
extern int DPeriod=5;
extern int Slowing=5;
extern int MA_Period=13;
extern int MA_method=1;
double exitL[],exitS[];
#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW,EMPTY,1);
SetIndexStyle(1,DRAW_ARROW,EMPTY,1);
SetIndexBuffer(0,exitL);
SetIndexBuffer(1,exitS);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
if(counted_bars<0) counted_bars=0;
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//----
for(int i = 0 ;i < limit ;i++)
{
double f1u = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,0,i);//MA line
double f2u = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,0,i+1);//MA line
double f3u = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,0,i+2);//MA line
double f1us = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,2,i);//signal stoch line
double f2us = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,2,i+1);//signal stoch line
double f3us = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,2,i+2);//signal stoch line
double f1d = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,1,i);//main stoch line
double f2d = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,1,i+1);//main stoch line
double f3d = iCustom(Symbol(),0,"Stomach",KPeriod,DPeriod,Slowing,MA_Period,MA_method,1,i+2);//main stoch line
double d22=(0);
double d23=(30);
double d24=(70);
if(f2u < f1u && f2u < d24 && f1u > d24)
{
exitL[i] = Low[i];
exitS[i] = 0.0;
}
else if(f2u > f1u && f2u > d23 && f1u < d23)
{
exitS[i] = High[i];
exitL[i] = 0.0;
}
}
//----
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
---