1. Мартингеил все таки оставить как было в пером варианте, но и увеличение лота в проценте от депо оставить как в первоначальном сове.
как сделать сброс счётчика лотов
Важно, чтобы советник открывал правильно ордера и на buy
Но Вы-же делали ранее советник по моему заказу на основе индикатора Kiosotto c динамическими уровнями
extern string IndName = "Kiosotto 2015 v4 Alert [mobidik]ms-nrp";
extern int Level = 15;
//+------------------------------------------------------------------+
//| Pointer7.mq4 |
//| Copyright 2020, AM2 |
//| http://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, AM2"
#property link "http://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 2
extern int Count=111;
extern string IndName1="!!!-MT4 X-TMA CHANNEL-01";
extern bool showTMA1 = 0;
extern int TMA1Per = 56;
extern int TMA1atr = 96;
extern int TMA1width = 1;
extern int TMA1clr = Red;
extern double TMA1atrMulti = 2.618;
extern bool showTMA2 = 1;
extern bool Extrapolate = 1;
extern int TMA2Per = 56;
extern int TMA2atr = 96;
extern int TMA2width = 1;
extern int TMA2price = 7;
extern int TMA2clr = Snow;
extern double TMA2atrMulti = 2.618;
extern string IndName2="Like-Stoch_Arr_chart";
extern int FS30Range = 5;
extern int FilterPeriod = 17;
extern double MartFiltr = 2.0;
extern int PriceConst = 6;
extern int MaPeriod = 5;
extern int MaMode = 3;
extern double LevelsCross = 0.95;
double up[];
double dn[];
datetime t=0;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
SetIndexStyle(0,DRAW_ARROW,0,5,Blue);
SetIndexArrow(0,108);
SetIndexBuffer(0,up);
SetIndexStyle(1,DRAW_ARROW,0,5,Red);
SetIndexArrow(1,108);
SetIndexBuffer(1,dn);
Comment("");
//---
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[])
{
//---
for(int i=1; i<Count; i++)
{
double blu=iCustom(NULL,0,IndName1,"","",showTMA1,TMA1Per,TMA1atr,TMA1width,TMA1clr,TMA1atrMulti,"",showTMA2,Extrapolate,TMA2Per,TMA2atr,TMA2width,TMA2price,TMA2clr,TMA2atrMulti,2,i);
double red=iCustom(NULL,0,IndName1,"","",showTMA1,TMA1Per,TMA1atr,TMA1width,TMA1clr,TMA1atrMulti,"",showTMA2,Extrapolate,TMA2Per,TMA2atr,TMA2width,TMA2price,TMA2clr,TMA2atrMulti,1,i);
double buy=iCustom(NULL,0,IndName2,FS30Range,FilterPeriod,MartFiltr,PriceConst,MaPeriod,MaMode,LevelsCross,2,i);
double sell=iCustom(NULL,0,IndName2,FS30Range,FilterPeriod,MartFiltr,PriceConst,MaPeriod,MaMode,LevelsCross,3,i);
if(sell<1000 && red<1000)
{
dn[i]=high[i];
}
if(buy<1000 && blu<1000)
{
up[i]=low[i];
}
}
if(t!=time[0])
{
if(up[1]<1000)
{
Alert(_Symbol+" Buy!");
SendNotification(_Symbol+" Buy!");
}
if(dn[1]<1000)
{
Alert(_Symbol+" Sell!");
SendNotification(_Symbol+" Sell!");
}
t=time[0];
}
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
AM2