浏览代码

ticket # 1585

Add enable check points on the entry condition 1 and two
AhtashamShahzad3 2 年之前
父节点
当前提交
46f2526ec0
共有 2 个文件被更改,包括 25 次插入12 次删除
  1. 二进制
      BOS_CHOCH.ex5
  2. 25 12
      BOS_CHOCH.mq5

二进制
BOS_CHOCH.ex5


+ 25 - 12
BOS_CHOCH.mq5

@@ -63,7 +63,10 @@ input       datetime             inpTime                 = 0;//First Line Draw t
63
 sinput      string               str2                    = "<><><><><><> General Settings <><><><><><>";
63
 sinput      string               str2                    = "<><><><><><> General Settings <><><><><><>";
64
 input       int                  magic_no                = 123;   //  Magic no
64
 input       int                  magic_no                = 123;   //  Magic no
65
 input       double               lot_size                = 0.1;
65
 input       double               lot_size                = 0.1;
66
-input lotcalculator lot_calculator = fix; //Lot Size Calculator
66
+input       lotcalculator        lot_calculator          = fix; //Lot Size Calculator
67
+input       bool                 Entry_condition_two_Enable = false; // Enable A1 Entry
68
+input       bool                 Entry_condition_one_Enable = false; // Enable A2 Entry
69
+
67
 
70
 
68
 input double risk = 1; //Risk in Percentage %
71
 input double risk = 1; //Risk in Percentage %
69
 input       double               stoploss                = 20;   // Stoploss Pips buffer from choch candle
72
 input       double               stoploss                = 20;   // Stoploss Pips buffer from choch candle
@@ -773,8 +776,10 @@ void choch(int i)
773
          int diff1 = Store_bos_last_index - (i);
776
          int diff1 = Store_bos_last_index - (i);
774
 
777
 
775
          // condition on 1st candle
778
          // condition on 1st candle
776
-
777
-         Entry_Action_1_up(Store_bos_last_index,i,diff1);
779
+         if(Entry_condition_one_Enable)
780
+           {
781
+            Entry_Action_1_up(Store_bos_last_index,i,diff1);
782
+           }
778
 
783
 
779
 
784
 
780
          low = iLow(Symbol(),PERIOD_CURRENT,i);
785
          low = iLow(Symbol(),PERIOD_CURRENT,i);
@@ -876,8 +881,10 @@ void choch(int i)
876
          signal = "";
881
          signal = "";
877
 
882
 
878
          // condition on 2st candle
883
          // condition on 2st candle
879
-
880
-         Entry_Action_2_up(Store_bos_last_index,i,diff1);
884
+         if(Entry_condition_two_Enable)
885
+           {
886
+            Entry_Action_2_up(Store_bos_last_index,i,diff1);
887
+           }
881
 
888
 
882
          low = iLow(Symbol(),PERIOD_CURRENT,i);
889
          low = iLow(Symbol(),PERIOD_CURRENT,i);
883
 
890
 
@@ -929,8 +936,10 @@ void choch(int i)
929
 
936
 
930
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
937
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
931
          int diff = Store_bos_last_index - (i);
938
          int diff = Store_bos_last_index - (i);
932
-
933
-         Entry_Action_1_down(Store_bos_last_index,i,diff);
939
+         if(Entry_condition_one_Enable)
940
+           {
941
+            Entry_Action_1_down(Store_bos_last_index,i,diff);
942
+           }
934
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
943
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
935
 
944
 
936
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
945
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
@@ -1030,8 +1039,10 @@ void choch(int i)
1030
            }
1039
            }
1031
 
1040
 
1032
          signal = "";
1041
          signal = "";
1033
-
1034
-         Entry_Action_2_down(Store_bos_last_index,i,diff);
1042
+         if(Entry_condition_two_Enable)
1043
+           {
1044
+            Entry_Action_2_down(Store_bos_last_index,i,diff);
1045
+           }
1035
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
1046
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
1036
 
1047
 
1037
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
1048
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
@@ -1115,7 +1126,7 @@ void bos2(int i)
1115
          for(int m=save_bullish_index; m>i; m--)
1126
          for(int m=save_bullish_index; m>i; m--)
1116
            {
1127
            {
1117
             double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,m);
1128
             double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,m);
1118
-           // find_high_time = iTime(Symbol(),PERIOD_CURRENT,m);
1129
+            // find_high_time = iTime(Symbol(),PERIOD_CURRENT,m);
1119
             if(find_high < find_high1)
1130
             if(find_high < find_high1)
1120
               {
1131
               {
1121
                find_high = find_high1;
1132
                find_high = find_high1;
@@ -1156,7 +1167,7 @@ void bos2(int i)
1156
          for(int m=save_bullish_index; m>i; m--)
1167
          for(int m=save_bullish_index; m>i; m--)
1157
            {
1168
            {
1158
             double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,m);
1169
             double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,m);
1159
-           // find_high_time = iTime(Symbol(),PERIOD_CURRENT,m);
1170
+            // find_high_time = iTime(Symbol(),PERIOD_CURRENT,m);
1160
             if(find_high < find_high1)
1171
             if(find_high < find_high1)
1161
               {
1172
               {
1162
                find_high = find_high1;
1173
                find_high = find_high1;
@@ -1315,7 +1326,7 @@ void bos2(int i)
1315
 
1326
 
1316
            }
1327
            }
1317
          low = find_low;
1328
          low = find_low;
1318
-         low_index_time = find_low_time; // here is the addition 
1329
+         low_index_time = find_low_time; // here is the addition
1319
          index_of_low = iBarShift(Symbol(), PERIOD_CURRENT, find_low_time, false);
1330
          index_of_low = iBarShift(Symbol(), PERIOD_CURRENT, find_low_time, false);
1320
          ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_low),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
1331
          ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_low),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
1321
          ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
1332
          ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
@@ -2119,3 +2130,5 @@ string checkCandle(int v)  // to check the candle is bullish or bearish
2119
 //+------------------------------------------------------------------+
2130
 //+------------------------------------------------------------------+
2120
 
2131
 
2121
 //+------------------------------------------------------------------+
2132
 //+------------------------------------------------------------------+
2133
+
2134
+//+------------------------------------------------------------------+