Project_N_1/Dochian_algo.mq5

63 lines
4.5 KiB
MQL5
Raw Permalink Normal View History

2025-05-30 16:18:18 +02:00
<EFBFBD><EFBFBD>#include <General_class_.mqh>
#include <Indicators_class.mqh>
#include <ExternalIndicators_class.mqh>
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
CGeneral_class gc;
CIndicators_class ind;
CExternalIndicators_class externalind;
input ENUM_TIMEFRAMES per = PERIOD_M1; //5@8>4 4;O B5:CI59 B>@3>2;8
input ENUM_TIMEFRAMES per2 = PERIOD_M5; //5@8>4 4;O 4>;3>A@>G=>3> B@5=40
//+------------------------------------------------------------------+
//| Donchian_channel |
//+------------------------------------------------------------------+
//enum Applied_Extrem //"8? M:AB@5<C<>2
// {
// HIGH_LOW,
// HIGH_LOW_OPEN,
// HIGH_LOW_CLOSE,
// OPEN_HIGH_LOW,
// CLOSE_HIGH_LOW
// };
////+-----------------------------------+
////| %+  " + "  |
////+-----------------------------------+
input int DonchianPeriod=20; //5@8>4 CA@54=5=8O
input Applied_Extrem Extremes=HIGH_LOW; //"8? M:AB@5<C<>2
input int Margins=-2;
input int Shift=0; //A4283 8=48:0B>@0 ?> 3>@87>=B0;8 2 10@0E
//+-----------------------------------+
//---- 8=48:0B>@=K5 1CD5@K
double upperBuffer[];
double middleBuffer[];
double lowerBuffer[];
int Handle_Donchian;
int OnInit()
{
externalind._Donchian_handle(_Symbol,per,DonchianPeriod,Margins,Shift,Handle_Donchian,true);
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
externalind._Dochian_buffer(upperBuffer, middleBuffer,lowerBuffer,Handle_Donchian);
}
//+------------------------------------------------------------------+