но проделанная работа уже кое что.
скажу сразу — это исследовательская работа.и что мы должны понять из этой фразы?
//+------------------------------------------------------------------+
//| Igrun.mq4 |
//| Copyright 2013, MetaQuotes Software Corp. |
//| http://www.mункцql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link "http://www.mункцql5.com"
#property version "1.00"
#property strict
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Aqua
extern string pair1 = "EURUSD";
extern string pair2 = "GBPUSD";
extern bool Деление = true;
extern int History = 100;
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
IndicatorBuffers(1);
IndicatorDigits(Digits);
SetIndexStyle (0,DRAW_HISTOGRAM,EMPTY,2);
SetIndexBuffer(0,ExtMapBuffer1);
IndicatorShortName(" Pair: "+pair1+" - "+pair2+" ");
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---
int i, Counted_bars;
Counted_bars = IndicatorCounted();
i = Bars-Counted_bars-1;
if (i>History-1) i=History-1;
for(i=History-1; i>=0; i--)
{
if( Деление)
{
ExtMapBuffer1[i]=(iClose(pair1,NULL,i)/iClose(pair2,NULL,i));
}
else
{
ExtMapBuffer1[i]=(iClose(pair1,NULL,i)*iClose(pair2,NULL,i));
}
i--;
}
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
В этом ни чего сложного нет.
//+------------------------------------------------------------------+
//| Equity_simple.mq4 |
//| Copyright © 2007, Xupypr |
//| fx_forever@mail.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, Xupypr"
#property link "fx_forever@mail.ru"
#property indicator_separate_window
#property indicator_buffers 4
#property indicator_color1 OrangeRed
#property indicator_color2 DodgerBlue
#property indicator_color3 SlateGray
#property indicator_color4 LimeGreen
#property indicator_width1 2
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1
extern bool Show_Balance=true;
extern bool Show_Equity=true;
extern bool Show_Margin=true;
extern bool Show_Free=true;
double Balance[],Equity[],Margin[],Free[];
//+----------------------------------------------------------------------------+
//| Custom indicator initialization function |
//+----------------------------------------------------------------------------+
int init()
{
SetIndexBuffer(0,Balance);
SetIndexLabel(0,"Balance");
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(1,Equity);
SetIndexLabel(1,"Equity");
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(2,Margin);
SetIndexLabel(2,"Margin");
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(3,Free);
SetIndexLabel(3,"Free");
SetIndexStyle(3,DRAW_LINE);
IndicatorShortName("BEMF");
IndicatorDigits(2);
return(0);
}
//+----------------------------------------------------------------------------+
//| Custom indicator iteration function |
//+----------------------------------------------------------------------------+
int start()
{
if (Show_Balance) Balance[0]=AccountBalance();
if (Show_Equity) Equity[0]=AccountEquity();
if (Show_Margin) Margin[0]=AccountMargin();
if (Show_Free) Free[0]=AccountFreeMargin();
return(0);
}
ssg