Уточните лучше сделав заказ на сайте мкл: www.mql5.com/ru/job
Что могу посмотреть я написал выше.
Но после того, как я его две недели писала
input int BCount=5; // количество баров для удаления текста
//+------------------------------------------------------------------+
//| BarSpread.mq4 |
//| Copyright 2015, MetaQuotes Software Corp. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link "https://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
input int Second=35;
input int Points=15;
double MaxSpread=0;
datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Put Text Function |
//+------------------------------------------------------------------+
void Text(string name,string text,double price,datetime time,color clr)
{
ObjectDelete(0,name);
//--- create a "Text" object
ObjectCreate(0,name,OBJ_TEXT,0,time,price);
//--- set the text
ObjectSetString(0,name,OBJPROP_TEXT,text);
//--- set the font of the text
ObjectSetString(0,name,OBJPROP_FONT,"Arial");
//--- set the font size
ObjectSetInteger(0,name,OBJPROP_FONTSIZE,9);
//--- set the method binding
ObjectSetInteger(0,name,OBJPROP_ANCHOR,ANCHOR_CENTER);
//--- set the color
ObjectSetInteger(0,name,OBJPROP_COLOR,clr);
}
//+------------------------------------------------------------------+
//| 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[])
{
//---
double ask=MarketInfo(NULL,MODE_ASK);
double bid=MarketInfo(NULL,MODE_BID);
double point=MarketInfo(NULL,MODE_POINT);
double spr=MarketInfo(NULL,MODE_SPREAD);
int BarTime=(int)(TimeCurrent()-time[0]);
double points=NormalizeDouble(MathAbs(open[0]-close[0])/Point,0);
if(BarTime>=Second && points>Points)
{
if(spr>MaxSpread) MaxSpread=spr;
if(t!=time[0]) MaxSpread=0;
t=time[0];
if((open[0]-close[0])>0) Text("Spread"+(string)time[0],(string)MaxSpread,low[0],time[0],Red);
if((open[0]-close[0])<0) Text("Spread"+(string)time[0],(string)MaxSpread,high[0],time[0],Blue);
}
Comment("\n Bar Points: ",points,
"\n Bar Time: ",BarTime,
"\n Bar Spread: ",spr,
"\n Max Spread: ",MaxSpread);
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//+------------------------------------------------------------------+
//| Удаление отложенных ордеров |
//+------------------------------------------------------------------+
void DelOrder()
{
bool del;
for(int i=OrdersTotal()-1;i>=0;i--)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
{
if(OrderSymbol()==Symbol() && OrderMagicNumber()==Magic)
{
if(OrderType()>1) del=OrderDelete(OrderTicket());
}
}
}
}
if(TimeCurrent()>YourTime) DelOrder();
double MA11=iMA(NULL,0,MA1Period,MA1Shift,0,0,Shift);
double MA12=iMA(NULL,0,MA1Period,MA1Shift,0,0,Shift+1);
double MA21=iMA(NULL,0,MA2Period,MA2Shift,0,0,Shift);
double MA22=iMA(NULL,0,MA2Period,MA2Shift,0,0,Shift+1);
AM2