Price Data Components
Indicators Used
Miscellaneous
0
Views
0
Downloads
0
Favorites
Back_In_Future
//+------------------------------------------------------------------+
//| Nazad_v_buduchee.mq4 |
//| Back_In_Future.mq4 |
//| 143alex@ramler.ru |
//+------------------------------------------------------------------+
#property copyright "143alex+Sanyooooook"
#property link "143alex@ramler.ru"
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Red
//---- input parameters
extern int denBarShift=1;//Äåíü ïî ñ÷¸òó íàçàä
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexLabel(0,"Den"+denBarShift);
IndicatorDigits(5);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//int
double Bid1;
double X1;
double X2;
double c1;
double c2;
double Razbeg1;
//ÓÇÍÀ¨Ì ÖÅÍÛ îòêðûòèÿ íóëåâîãî è èíòåðåñóþùåãî äíåâíîãî áàðà
X1=iOpen(NULL,1440,0);
X2=iOpen(NULL,1440,denBarShift);
//óçíà¸ì íà ñêîëüêî ñìåùàòüñÿ
c1=iBarShift(NULL,1,iTime(NULL,PERIOD_D1,denBarShift));
c2=iBarShift(NULL,1,iTime(NULL,PERIOD_D1,0));
Print("ñìåùåíèå",(c1-c2));
SetIndexShift(0,(c1-c2));
//ÓÇÍÀ¨Ì ÐÀÇÍÈÖÓ
Razbeg1=X2-X1;
//------------------------------------------------------------------
//------------------------------------------------------------------
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
int i,limit, counted_bars = IndicatorCounted();
int k;
//----
if(Bars <= 10100)
return(0);
//---- initial zero
if(counted_bars < 1)
for(i = 1;i <= 10100; i++)
ExtMapBuffer1[Bars-i] = 0.0;
//----
i = Bars - 10100 - 1;
if(counted_bars >= 10100)
i = Bars - counted_bars - 1;
//----
while (i>0)
{
{
if (Razbeg1<0)
Bid1=Razbeg1*(-1)+iMA(NULL,1,2,0,3,5,i);
if (Razbeg1>0)
Bid1=iMA(NULL,1,2,0,3,5,i)-Razbeg1;
ExtMapBuffer1[i]=NormalizeDouble(Bid1,Digits);
}
i--;
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
{
if (Razbeg1<0)
Bid1=Razbeg1*(-1)+iMA(NULL,1,2,0,3,5,0);
if (Razbeg1>0)
Bid1=iMA(NULL,1,2,0,3,5,0)-Razbeg1;
ExtMapBuffer1[0]=NormalizeDouble(Bid1,Digits);
}
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
---