//+------------------------------------------------------------------+
//| AutoStoha.mq4 |
//| Copyright 2024, AM2 |
//| https://www.forexsystems.biz |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, AM2"
#property link "https://www.forexsystems.biz"
#property version "1.00"
#property strict
#property indicator_chart_window
input int main=75;
input int kp=5;
input int dp=3;
input int sl=3;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//--- indicator buffers mapping
EventSetTimer(1);
//---
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[])
{
//---
//--- return value of prev_calculated for next call
return(rates_total);
}
//+------------------------------------------------------------------+
//| Timer function |
//+------------------------------------------------------------------+
void OnTimer()
{
int i=0,k=0,n=0;
int sto=0;
for(i=kp; i<main; i++)
{
for(k=dp; i<22; i++)
{
for(n=sl; i<22; i++)
{
sto=int(iStochastic(NULL,0,i,k,n,0,0,0,0));
if(sto==main)
break;
}
}
}
Comment("\n KPeriod: ",i,
"\n DPeriod: ",k,
"\n Slowing: ",n,
"\n Stoha: ",sto);
}
//+------------------------------------------------------------------+
проверять на открытом рынке нужно будет
AM2