Bladeren bron

ticket # 1585

Add enable check points on the entry condition 1 and two
AhtashamShahzad3 2 jaren geleden
bovenliggende
commit
46f2526ec0
2 gewijzigde bestanden met toevoegingen van 25 en 12 verwijderingen
  1. BIN
      BOS_CHOCH.ex5
  2. 25 12
      BOS_CHOCH.mq5

BIN
BOS_CHOCH.ex5


+ 25 - 12
BOS_CHOCH.mq5

@@ -63,7 +63,10 @@ input       datetime             inpTime                 = 0;//First Line Draw t
63 63
 sinput      string               str2                    = "<><><><><><> General Settings <><><><><><>";
64 64
 input       int                  magic_no                = 123;   //  Magic no
65 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 71
 input double risk = 1; //Risk in Percentage %
69 72
 input       double               stoploss                = 20;   // Stoploss Pips buffer from choch candle
@@ -773,8 +776,10 @@ void choch(int i)
773 776
          int diff1 = Store_bos_last_index - (i);
774 777
 
775 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 785
          low = iLow(Symbol(),PERIOD_CURRENT,i);
@@ -876,8 +881,10 @@ void choch(int i)
876 881
          signal = "";
877 882
 
878 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 889
          low = iLow(Symbol(),PERIOD_CURRENT,i);
883 890
 
@@ -929,8 +936,10 @@ void choch(int i)
929 936
 
930 937
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
931 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 943
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
935 944
 
936 945
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
@@ -1030,8 +1039,10 @@ void choch(int i)
1030 1039
            }
1031 1040
 
1032 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 1046
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
1036 1047
 
1037 1048
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
@@ -1115,7 +1126,7 @@ void bos2(int i)
1115 1126
          for(int m=save_bullish_index; m>i; m--)
1116 1127
            {
1117 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 1130
             if(find_high < find_high1)
1120 1131
               {
1121 1132
                find_high = find_high1;
@@ -1156,7 +1167,7 @@ void bos2(int i)
1156 1167
          for(int m=save_bullish_index; m>i; m--)
1157 1168
            {
1158 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 1171
             if(find_high < find_high1)
1161 1172
               {
1162 1173
                find_high = find_high1;
@@ -1315,7 +1326,7 @@ void bos2(int i)
1315 1326
 
1316 1327
            }
1317 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 1330
          index_of_low = iBarShift(Symbol(), PERIOD_CURRENT, find_low_time, false);
1320 1331
          ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_low),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
1321 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
+//+------------------------------------------------------------------+