Ver Fonte

update the bos function

AhtashamShahzad3 há 2 anos atrás
pai
commit
f4cd7e45d1
2 ficheiros alterados com 26 adições e 4 exclusões
  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)
       if(close > high)
         {
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
-         Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
-         for(int j = i  ; j < Store_bos_last_index ; j++)
+
+         int lastindex = 0;
+
+         if(store_last_bos_index_time > choch_index_time)
+           {
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
+           }
+         else
+           {
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
+           }
+
+         for(int j = i  ; j < lastindex ; j++)
            {
             if(checkCandle(j) == "Bearish")
               {
@@ -226,8 +237,19 @@ void Bos(int i)
       if(close1 < low)
         {
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
-         Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
-         for(int j= i ; j < Store_bos_last_index ; j++)
+
+         int lastindex = 0;
+
+         if(store_last_bos_index_time > choch_index_time)
+           {
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
+           }
+         else
+           {
+            lastindex = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
+           }
+           
+         for(int j= i ; j < lastindex ; j++)
            {
             if(checkCandle(j) == "Bullish")
               {