Pārlūkot izejas kodu

update the bos function

AhtashamShahzad3 2 gadi atpakaļ
vecāks
revīzija
f4cd7e45d1
2 mainītis faili ar 26 papildinājumiem un 4 dzēšanām
  1. BIN
      BOS_CHOCH.ex5
  2. 26 4
      BOS_CHOCH.mq5

BIN
BOS_CHOCH.ex5


+ 26 - 4
BOS_CHOCH.mq5

@@ -134,8 +134,19 @@ void Bos(int i)
134
       if(close > high)
134
       if(close > high)
135
         {
135
         {
136
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
136
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
137
-         Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
138
-         for(int j = i  ; j < Store_bos_last_index ; j++)
137
+
138
+         int lastindex = 0;
139
+
140
+         if(store_last_bos_index_time > choch_index_time)
141
+           {
142
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
143
+           }
144
+         else
145
+           {
146
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
147
+           }
148
+
149
+         for(int j = i  ; j < lastindex ; j++)
139
            {
150
            {
140
             if(checkCandle(j) == "Bearish")
151
             if(checkCandle(j) == "Bearish")
141
               {
152
               {
@@ -226,8 +237,19 @@ void Bos(int i)
226
       if(close1 < low)
237
       if(close1 < low)
227
         {
238
         {
228
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
239
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
229
-         Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
230
-         for(int j= i ; j < Store_bos_last_index ; j++)
240
+
241
+         int lastindex = 0;
242
+
243
+         if(store_last_bos_index_time > choch_index_time)
244
+           {
245
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
246
+           }
247
+         else
248
+           {
249
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
250
+           }
251
+           
252
+         for(int j= i ; j < lastindex ; j++)
231
            {
253
            {
232
             if(checkCandle(j) == "Bullish")
254
             if(checkCandle(j) == "Bullish")
233
               {
255
               {