сделайте пожалуйста в советнике, сигнал на открытие ордера не только пересечение МА телом свечи, но и касание ценой линию МА
и чтобы возле сделки была колонка с открытым лотом,
Алерт творит тихий ужас, куча сигналов в секунду и дикий треск в динамиках.
А без алертов стрелки не отображаются почему то
//+------------------------------------------------------------------+
//| FractalMA.mq4 |
//| Copyright 2019, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
double up[];
double dn[];
input int MAPeriod=5;
input int BarsCount=11;
input bool Alerts=1;
datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_ARROW,0,1,Lime);
SetIndexStyle(1,DRAW_ARROW,0,1,Red);
SetIndexBuffer(0,up);
SetIndexBuffer(1,dn);
SetIndexArrow(0,233);
SetIndexArrow(1,234);
//---
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[])
{
//---
if(t!=time[0] && Alerts)
{
for(int i=0;i<BarsCount;i++)
{
double ma=iMA(NULL,0,MAPeriod,0,0,0,i);
double hi=iFractals(NULL,0,MODE_UPPER,i+4);
double lo=iFractals(NULL,0,MODE_LOWER,i+4);
if(close[i]>ma && lo>0)
{
up[i]=low[i];
Alert(_Symbol+" Buy!");
}
if(close[i]<ma && hi>0)
{
dn[i]=high[i];
Alert(_Symbol+" Sell!");
}
}
t=time[0];
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
отношения со своим программистом, который, к сожалению, временно не у дел
добавляю по сумме больше максимума:
индикатор: www.opentraders.ru/downloads/2264/
AM2