EA-Setka-2/logic/rsi_cci/definesRC.mqh

75 lines
5.9 KiB
MQL5
Raw Permalink Normal View History

2025-05-30 14:50:44 +02:00
<EFBFBD><EFBFBD>#ifndef DEFINES_RC_MQH
#define DEFINES_RC_MQH
#define IND_ARRAY_BUFFER_SIZE 1
// 0AB@>9:8 2E>40 ?> 8=48:0B>@0< RSI 8 CCIINPUT string Indicator_settings;
DEFINES_LABEL_NAME ( rsi_cci_filter_settings,"$8;LB@ - RSI-CCI" ); //===== $8;LB@K, " + RSI-CCI D8;LB@
DEFINES_LABEL_NAME ( rsi_cci_filter_settings_first,"0AB@>9:8 ?5@2>3> 2E>40" ); //=====
INPUT bool use_for1Order = false;
INPUT enum_time_frames CandleTimeframe = H1_;
INPUT enum_time_frames RsiTimeframe = M5_;
INPUT int RsiPeriod = 14;
//5@8>4 RSI D8;LB@0 1-3> :>;5=0
INPUT int RsiLevel = 20;
INPUT enum_time_frames CciTimeframe = M5_;
INPUT int CciPeriod = 30;
INPUT int CciLevel = 50;
DEFINES_LABEL_NAME ( rsi_cci_filter_settings_next,"0AB@>9:8 ?>A;54CNI8E :>;5=" ); //=====
INPUT int use_for_next_Order = 0;
INPUT enum_time_frames CandleTimeframeNext = H1_;
INPUT enum_time_frames RsiTimeframeNext = M5_;
//#@>25=L A@010BK20=8O RSI D8;LB@0 50+\- 1-3> :>;5=0
INPUT int RsiPeriodNext = 14;
//5@8>4 RSI D8;LB@0 N-3> :>;5=0
INPUT int RsiLevelNext = 20;
//#@>25=L A@010BK20=8O RSI D8;LB@0 50+\- N-3> :>;5=0
INPUT enum_time_frames CciTimeframeNext = M5_;
INPUT int CciPeriodNext = 30;
INPUT int CciLevelNext = 50;
//--- @>25@:0 ?0@0<5B@>2
bool rc_defines_validate(){
return valid_tfrm ( custom_tf_to_tf(CandleTimeframe) )
&& valid_tfrm ( custom_tf_to_tf(CandleTimeframeNext) )
&& valid_tfrm ( custom_tf_to_tf(RsiTimeframe) )
&& valid_inte ( RsiPeriod, RsiPeriod > 0 )
&& valid_tint ( RsiLevel)
&& valid_tfrm ( custom_tf_to_tf(RsiTimeframeNext) )
&& valid_inte ( RsiPeriodNext, RsiPeriodNext > 0 )
&& valid_tint ( RsiLevelNext)
&& valid_tfrm ( custom_tf_to_tf(CciTimeframe) )
&& valid_inte ( CciPeriod, CciPeriod > 0 )
&& valid_tint ( CciLevel)
&& valid_tfrm ( custom_tf_to_tf(CciTimeframeNext) )
&& valid_inte ( CciPeriodNext, CciPeriodNext > 0 )
&& valid_tint ( CciLevelNext)
&& valid_tboo ( use_for1Order)
&& valid_inte ( use_for_next_Order, use_for_next_Order>=0);
}
//--- Copy inputs to settings
void rc_settings(setting_t *result){
result.CandleTimeFrame1 = custom_tf_to_tf(CandleTimeframe);
result.CandleTimeFrame = custom_tf_to_tf(CandleTimeframeNext);
result.RsiTimeFrame = custom_tf_to_tf(RsiTimeframeNext);
result.RsiTimeFrame1 = custom_tf_to_tf(RsiTimeframe);
result.RsiPeriod1 = RsiPeriod;
result.RsiLevel1 = RsiLevel;
result.RsiPeriod = RsiPeriodNext;
result.RsiLevel = RsiLevelNext;
result.CciTimeFrame1 = custom_tf_to_tf(CciTimeframe);
result.CciTimeFrame = custom_tf_to_tf(CciTimeframeNext);
result.CciPeriod1 = CciPeriod;
result.CciLevel1 = CciLevel;
result.CciPeriod = CciPeriodNext;
result.CciLevel = CciLevelNext;
result.use_for1Order = use_for1Order;
result.use_for_next_Order = use_for_next_Order;
}
#endif