Bläddra i källkod

ticket # 1483

update high and low in new bos condition
AhtashamShahzad3 2 år sedan
förälder
incheckning
394b1c7694
2 ändrade filer med 148 tillägg och 75 borttagningar
  1. BIN
      BOS_CHOCH.ex5
  2. 148 75
      BOS_CHOCH.mq5

BIN
BOS_CHOCH.ex5


+ 148 - 75
BOS_CHOCH.mq5

@@ -123,13 +123,13 @@ void Bos(int i)
123
 
123
 
124
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
124
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
125
 
125
 
126
-         Print("high index ",high_index);
126
+         //  Print("high index ",high_index);
127
 
127
 
128
          int count = (high_index-1) - i;
128
          int count = (high_index-1) - i;
129
 
129
 
130
 
130
 
131
 
131
 
132
-         Print("count is ",count);
132
+         //  Print("count is ",count);
133
 
133
 
134
          for(int j=count; j >= 1; j--)
134
          for(int j=count; j >= 1; j--)
135
            {
135
            {
@@ -143,7 +143,8 @@ void Bos(int i)
143
                  }
143
                  }
144
 
144
 
145
                high = high1;
145
                high = high1;
146
-               Print(" high is updated : ",high);
146
+
147
+               // Print(" high is updated : ",high);
147
 
148
 
148
 
149
 
149
                ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
150
                ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
@@ -159,13 +160,13 @@ void Bos(int i)
159
                Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
160
                Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
160
 
161
 
161
 
162
 
162
-               Print("last bos index is ",Store_bos_last_index);
163
+               //   Print("last bos index is ",Store_bos_last_index);
163
 
164
 
164
 
165
 
165
-               Print("bearish candle found and its low is ",low);
166
+               //    Print("bearish candle found and its low is ",low);
166
 
167
 
167
                low =  iLow(Symbol(),PERIOD_CURRENT,high_index-j);
168
                low =  iLow(Symbol(),PERIOD_CURRENT,high_index-j);
168
-               Print("bearish candle found and its low is ",low);
169
+               //     Print("bearish candle found and its low is ",low);
169
                bearish_found = true;
170
                bearish_found = true;
170
                count = high_index-j;
171
                count = high_index-j;
171
                index_of_low_time = iTime(Symbol(),PERIOD_CURRENT,high_index-j);
172
                index_of_low_time = iTime(Symbol(),PERIOD_CURRENT,high_index-j);
@@ -189,7 +190,7 @@ void Bos(int i)
189
 
190
 
190
                   //index_of_low = high_index- k;
191
                   //index_of_low = high_index- k;
191
 
192
 
192
-                  Print("                                       ------------------index of low ",index_of_low);
193
+                  //     Print("                                       ------------------index of low ",index_of_low);
193
                   bearish_found = false;
194
                   bearish_found = false;
194
 
195
 
195
 
196
 
@@ -225,8 +226,8 @@ void Bos(int i)
225
            }
226
            }
226
 
227
 
227
 
228
 
228
-         Print("high of uptrend is ", high);
229
-         Print("low of uptrend is ", low);
229
+         // Print("high of uptrend is ", high);
230
+         //  Print("low of uptrend is ", low);
230
 
231
 
231
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
232
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
232
 
233
 
@@ -273,11 +274,11 @@ void Bos(int i)
273
 
274
 
274
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
275
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
275
 
276
 
276
-         Print("low index ",low_index);
277
+         //  Print("low index ",low_index);
277
 
278
 
278
 
279
 
279
          int count = (low_index-1) - i;
280
          int count = (low_index-1) - i;
280
-         Print("count is ",count);
281
+         //    Print("count is ",count);
281
 
282
 
282
          for(int j=count; j >= 1; j--)
283
          for(int j=count; j >= 1; j--)
283
            {
284
            {
@@ -303,7 +304,7 @@ void Bos(int i)
303
 
304
 
304
 
305
 
305
                store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
306
                store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
306
-               Print(store_last_bos_index_time);
307
+               //         Print(store_last_bos_index_time);
307
 
308
 
308
                Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
309
                Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
309
 
310
 
@@ -313,14 +314,14 @@ void Bos(int i)
313
                //------
314
                //------
314
                low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
315
                low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
315
 
316
 
316
-               Print("low index ",low_index);
317
+               //       Print("low index ",low_index);
317
 
318
 
318
 
319
 
319
 
320
 
320
-               Print("bullish candle found and its high is ",high);
321
+               //       Print("bullish candle found and its high is ",high);
321
 
322
 
322
                high =  iHigh(Symbol(),PERIOD_CURRENT,low_index-j);
323
                high =  iHigh(Symbol(),PERIOD_CURRENT,low_index-j);
323
-               Print("bullish candle found and its high is ",high);
324
+               //         Print("bullish candle found and its high is ",high);
324
                bullish_found = true;
325
                bullish_found = true;
325
                count = low_index-j;
326
                count = low_index-j;
326
                index_of_high_time = iTime(Symbol(),PERIOD_CURRENT,low_index-j);
327
                index_of_high_time = iTime(Symbol(),PERIOD_CURRENT,low_index-j);
@@ -371,8 +372,8 @@ void Bos(int i)
371
 
372
 
372
 
373
 
373
 
374
 
374
-         Print("high is ", high);
375
-         Print("low is ", low);
375
+         //     Print("high is ", high);
376
+         //     Print("low is ", low);
376
          low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
377
          low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
377
 
378
 
378
 
379
 
@@ -588,7 +589,7 @@ void choch(int i)
588
 
589
 
589
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
590
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
590
 
591
 
591
-         Print("last bos index is ",Store_bos_last_index);
592
+         // Print("last bos index is ",Store_bos_last_index);
592
 
593
 
593
          int diff1 = Store_bos_last_index - (i);
594
          int diff1 = Store_bos_last_index - (i);
594
 
595
 
@@ -613,9 +614,9 @@ void choch(int i)
613
 
614
 
614
          //Entry_Action_1_up(Store_bos_last_index,i,di);
615
          //Entry_Action_1_up(Store_bos_last_index,i,di);
615
 
616
 
616
-         Print("low update due to choch : ", low);
617
+         //   Print("low update due to choch : ", low);
617
          trend = "downtrend";
618
          trend = "downtrend";
618
-         Print("choch at uptrend index --- ", iTime(Symbol(),PERIOD_CURRENT,i));
619
+         //    Print("choch at uptrend index --- ", iTime(Symbol(),PERIOD_CURRENT,i));
619
          choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
620
          choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
620
         }
621
         }
621
 
622
 
@@ -640,7 +641,7 @@ void choch(int i)
640
          ObjectSetInteger(0,"line7"+iTime(Symbol(),PERIOD_CURRENT,i),OBJPROP_COLOR,clrGreen);
641
          ObjectSetInteger(0,"line7"+iTime(Symbol(),PERIOD_CURRENT,i),OBJPROP_COLOR,clrGreen);
641
 
642
 
642
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
643
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
643
-         Print("last bos index is ",Store_bos_last_index);
644
+         //    Print("last bos index is ",Store_bos_last_index);
644
 
645
 
645
          int diff = Store_bos_last_index - (i);
646
          int diff = Store_bos_last_index - (i);
646
 
647
 
@@ -664,8 +665,8 @@ void choch(int i)
664
 
665
 
665
          trend = "uptrend";
666
          trend = "uptrend";
666
 
667
 
667
-         Print("high is update due to choch : ", high);
668
-         Print("choch at downtrend index ---- ", iTime(Symbol(),PERIOD_CURRENT,i));
668
+         //    Print("high is update due to choch : ", high);
669
+         //   Print("choch at downtrend index ---- ", iTime(Symbol(),PERIOD_CURRENT,i));
669
          choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
670
          choch_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
670
 
671
 
671
         }
672
         }
@@ -684,6 +685,12 @@ void bos2(int i)
684
    bool cnd;
685
    bool cnd;
685
    bool candle_bullish = false;
686
    bool candle_bullish = false;
686
    bool candle_bearish = false;
687
    bool candle_bearish = false;
688
+   double find_high = 0.0;
689
+   datetime find_high_time = 0.0;
690
+
691
+   double find_low = 0.0;
692
+   datetime find_low_time = 0.0;
693
+
687
    if(trend == "downtrend")
694
    if(trend == "downtrend")
688
      {
695
      {
689
 
696
 
@@ -711,9 +718,16 @@ void bos2(int i)
711
            }
718
            }
712
          choch_index = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
719
          choch_index = iBarShift(Symbol(), PERIOD_CURRENT, choch_index_time, false);
713
 
720
 
714
-
721
+         find_high  = iHigh(Symbol(),PERIOD_CURRENT,choch_index);
715
          for(int j=choch_index; j>=i; j--)
722
          for(int j=choch_index; j>=i; j--)
716
            {
723
            {
724
+            double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,j);
725
+
726
+            if(find_high < find_high1)
727
+              {
728
+               find_high = find_high1;
729
+               find_high_time = iTime(Symbol(),PERIOD_CURRENT,j);
730
+              }
717
 
731
 
718
             if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
732
             if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
719
               {
733
               {
@@ -734,8 +748,17 @@ void bos2(int i)
734
               }
748
               }
735
            }
749
            }
736
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
750
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
751
+
752
+         find_high  = iHigh(Symbol(),PERIOD_CURRENT,Store_bos_last_index);
737
          for(int j=Store_bos_last_index; j>=i; j--)
753
          for(int j=Store_bos_last_index; j>=i; j--)
738
            {
754
            {
755
+            double find_high1 = iHigh(Symbol(),PERIOD_CURRENT,j);
756
+
757
+            if(find_high < find_high1)
758
+              {
759
+               find_high = find_high1;
760
+               find_high_time = iTime(Symbol(),PERIOD_CURRENT,j);
761
+              }
739
             if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
762
             if(iClose(Symbol(),PERIOD_CURRENT,j) < iClose(Symbol(),PERIOD_CURRENT,i) || iLow(Symbol(),PERIOD_CURRENT,j) < iLow(Symbol(),PERIOD_CURRENT,i))
740
               {
763
               {
741
                cnd = false;
764
                cnd = false;
@@ -747,6 +770,20 @@ void bos2(int i)
747
       if(cnd == true && candle_bullish == true)
770
       if(cnd == true && candle_bullish == true)
748
         {
771
         {
749
 
772
 
773
+         Print("high is --------------",find_high);
774
+         Print("high time  is --------------",find_high_time);
775
+
776
+         if(object_find("high") > 0)
777
+           {
778
+            ObjectDelete(0,"high");
779
+
780
+           }
781
+         high = find_high;
782
+         index_of_high = iBarShift(Symbol(), PERIOD_CURRENT, find_high_time, false);
783
+         ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_high),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
784
+         ObjectSetInteger(0,"high",OBJPROP_RAY_RIGHT,true);
785
+         ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
786
+
750
          if(object_find("low") > 0)
787
          if(object_find("low") > 0)
751
            {
788
            {
752
             ObjectDelete(0,"low");
789
             ObjectDelete(0,"low");
@@ -761,23 +798,23 @@ void bos2(int i)
761
 
798
 
762
 
799
 
763
          ObjectCreate(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),low);
800
          ObjectCreate(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),low);
764
-         ObjectSetString(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos");
801
+         ObjectSetString(0,"line2"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos2");
765
 
802
 
766
 
803
 
767
          store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
804
          store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
768
-         Print(store_last_bos_index_time);
805
+         // Print(store_last_bos_index_time);
769
 
806
 
770
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
807
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
771
 
808
 
772
 
809
 
773
-         Print("last bos index is ",Store_bos_last_index);
810
+         //  Print("last bos index is ",Store_bos_last_index);
774
 
811
 
775
-         Print("low is ", low);
812
+         //   Print("low is ", low);
776
          low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
813
          low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
777
 
814
 
778
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
815
          low_index = iBarShift(Symbol(), PERIOD_CURRENT, low_index_time, false);
779
 
816
 
780
-         Print("low index ",low_index);
817
+         //    Print("low index ",low_index);
781
          cnd = false;
818
          cnd = false;
782
          candle_bullish = false;
819
          candle_bullish = false;
783
 
820
 
@@ -803,16 +840,27 @@ void bos2(int i)
803
 
840
 
804
       if(choch_index_time < store_last_bos_index_time)
841
       if(choch_index_time < store_last_bos_index_time)
805
         {
842
         {
843
+
806
          for(int m=Store_bos_last_index; m>i; m--)
844
          for(int m=Store_bos_last_index; m>i; m--)
807
            {
845
            {
808
             if(checkCandle(m) == "Bearish")
846
             if(checkCandle(m) == "Bearish")
809
               {
847
               {
810
-               Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
848
+               //   Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
811
                candle_bearish = true;
849
                candle_bearish = true;
812
               }
850
               }
813
            }
851
            }
852
+         find_low  = iLow(Symbol(),PERIOD_CURRENT,Store_bos_last_index);
814
          for(int j=Store_bos_last_index; j>=i; j--)
853
          for(int j=Store_bos_last_index; j>=i; j--)
815
            {
854
            {
855
+
856
+            double find_low1 = iLow(Symbol(),PERIOD_CURRENT,j);
857
+
858
+            if(find_low > find_low1)
859
+              {
860
+               find_low = find_low1;
861
+               find_low_time = iTime(Symbol(),PERIOD_CURRENT,j);
862
+              }
863
+
816
             if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
864
             if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
817
               {
865
               {
818
                cnd = false;
866
                cnd = false;
@@ -827,12 +875,20 @@ void bos2(int i)
827
            {
875
            {
828
             if(checkCandle(m) == "Bearish")
876
             if(checkCandle(m) == "Bearish")
829
               {
877
               {
830
-               Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
878
+               //    Print("found bearish at index ",iTime(Symbol(),PERIOD_CURRENT,m));
831
                candle_bearish = true;
879
                candle_bearish = true;
832
               }
880
               }
833
            }
881
            }
882
+         find_low  = iLow(Symbol(),PERIOD_CURRENT,choch_index);
834
          for(int j=choch_index; j>=i; j--)
883
          for(int j=choch_index; j>=i; j--)
835
            {
884
            {
885
+            double find_low1 = iLow(Symbol(),PERIOD_CURRENT,j);
886
+
887
+            if(find_low > find_low1)
888
+              {
889
+               find_low = find_low1;
890
+               find_low_time = iTime(Symbol(),PERIOD_CURRENT,j);
891
+              }
836
 
892
 
837
             if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
893
             if(iClose(Symbol(),PERIOD_CURRENT,j) > iClose(Symbol(),PERIOD_CURRENT,i) || iHigh(Symbol(),PERIOD_CURRENT,j) > iHigh(Symbol(),PERIOD_CURRENT,i))
838
               {
894
               {
@@ -848,6 +904,24 @@ void bos2(int i)
848
       if(cnd == true && candle_bearish == true)
904
       if(cnd == true && candle_bearish == true)
849
         {
905
         {
850
 
906
 
907
+         Print("low is --------------",find_low);
908
+         Print("low time  is --------------",find_low_time);
909
+
910
+         if(object_find("low") > 0)
911
+           {
912
+            ObjectDelete(0,"low");
913
+
914
+           }
915
+         low = find_low;
916
+         index_of_low = iBarShift(Symbol(), PERIOD_CURRENT, find_low_time, false);
917
+         ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,index_of_low),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
918
+         ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
919
+         ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
920
+
921
+
922
+
923
+
924
+
851
          if(object_find("high") > 0)
925
          if(object_find("high") > 0)
852
            {
926
            {
853
             ObjectDelete(0,"high");
927
             ObjectDelete(0,"high");
@@ -855,7 +929,7 @@ void bos2(int i)
855
            }
929
            }
856
 
930
 
857
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
931
          high = iHigh(Symbol(),PERIOD_CURRENT,i);
858
-         Print(" high is updated : ",high);
932
+         //  Print(" high is updated : ",high);
859
 
933
 
860
 
934
 
861
          ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
935
          ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
@@ -863,7 +937,7 @@ void bos2(int i)
863
          ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
937
          ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
864
 
938
 
865
          ObjectCreate(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),high);
939
          ObjectCreate(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),high);
866
-         ObjectSetString(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos");
940
+         ObjectSetString(0,"line1"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"bos2");
867
 
941
 
868
          store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
942
          store_last_bos_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
869
          Print(store_last_bos_index_time);
943
          Print(store_last_bos_index_time);
@@ -871,17 +945,17 @@ void bos2(int i)
871
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
945
          Store_bos_last_index = iBarShift(Symbol(), PERIOD_CURRENT, store_last_bos_index_time, false);
872
 
946
 
873
 
947
 
874
-         Print("last bos index is ",Store_bos_last_index);
948
+         //  Print("last bos index is ",Store_bos_last_index);
875
 
949
 
876
 
950
 
877
 
951
 
878
 
952
 
879
-         Print("high is ", high);
953
+         //   Print("high is ", high);
880
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
954
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
881
 
955
 
882
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
956
          high_index = iBarShift(Symbol(), PERIOD_CURRENT, high_index_time, false);
883
 
957
 
884
-         Print("low index ",high_index);
958
+         //   Print("low index ",high_index);
885
 
959
 
886
 
960
 
887
          cnd = false;
961
          cnd = false;
@@ -911,8 +985,8 @@ void third_Condition(int i)
911
       if(low2 < low)
985
       if(low2 < low)
912
         {
986
         {
913
          third_condition_met = true;
987
          third_condition_met = true;
914
-        // ObjectCreate(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
915
-       //  ObjectSetString(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
988
+         ObjectCreate(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
989
+         ObjectSetString(0,"line5"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
916
          low = low2;
990
          low = low2;
917
 
991
 
918
          low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
992
          low_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
@@ -930,14 +1004,14 @@ void third_Condition(int i)
930
 
1004
 
931
          ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
1005
          ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
932
 
1006
 
933
-         Print("low update due to third condition",low," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
1007
+         //   Print("low update due to third condition",low," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
934
         }
1008
         }
935
 
1009
 
936
       if(high2 > high)
1010
       if(high2 > high)
937
         {
1011
         {
938
          //third_condition_met = true;
1012
          //third_condition_met = true;
939
-        // ObjectCreate(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
940
-        // ObjectSetString(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
1013
+         ObjectCreate(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
1014
+         ObjectSetString(0,"line51"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
941
          high = high2;
1015
          high = high2;
942
 
1016
 
943
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
1017
          high_index_time = iTime(Symbol(),PERIOD_CURRENT,i);
@@ -955,7 +1029,7 @@ void third_Condition(int i)
955
 
1029
 
956
          ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
1030
          ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
957
 
1031
 
958
-         Print("high update due to third condition",high," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
1032
+         //       Print("high update due to third condition",high," time of the candle is ",iTime(Symbol(),PERIOD_CURRENT,i));
959
         }
1033
         }
960
 
1034
 
961
 
1035
 
@@ -969,8 +1043,8 @@ void third_Condition(int i)
969
       if(high2 > high)
1043
       if(high2 > high)
970
         {
1044
         {
971
          //third_condition_met = true;
1045
          //third_condition_met = true;
972
-       //  ObjectCreate(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
973
-       //  ObjectSetString(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
1046
+         ObjectCreate(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iHigh(Symbol(),PERIOD_CURRENT,i));
1047
+         ObjectSetString(0,"line6"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
974
 
1048
 
975
          high = high2;
1049
          high = high2;
976
 
1050
 
@@ -986,14 +1060,14 @@ void third_Condition(int i)
986
          ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
1060
          ObjectCreate(0,"high",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),high,iTime(Symbol(),PERIOD_CURRENT,0),high);
987
          ObjectSetInteger(0,"high",OBJPROP_RAY_RIGHT,true);
1061
          ObjectSetInteger(0,"high",OBJPROP_RAY_RIGHT,true);
988
          ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
1062
          ObjectSetInteger(0,"high",OBJPROP_COLOR,clrBlue);
989
-         Print("high update due to third condition",high);
1063
+         //       Print("high update due to third condition",high);
990
         }
1064
         }
991
 
1065
 
992
       if(low2 < low)
1066
       if(low2 < low)
993
         {
1067
         {
994
          third_condition_met = true;
1068
          third_condition_met = true;
995
-       //  ObjectCreate(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
996
-      //   ObjectSetString(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
1069
+         ObjectCreate(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i),OBJ_TEXT,0,iTime(Symbol(),PERIOD_CURRENT,i),iLow(Symbol(),PERIOD_CURRENT,i));
1070
+         ObjectSetString(0,"line61"+iTime(Symbol(),PERIOD_CURRENT,i), OBJPROP_TEXT,"3_C");
997
 
1071
 
998
          low = low2;
1072
          low = low2;
999
 
1073
 
@@ -1006,11 +1080,11 @@ void third_Condition(int i)
1006
             ObjectDelete(0,"low");
1080
             ObjectDelete(0,"low");
1007
 
1081
 
1008
            }
1082
            }
1009
-         Print("low value is ", low);
1083
+         //      Print("low value is ", low);
1010
          ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
1084
          ObjectCreate(0,"low",OBJ_TREND,0,iTime(Symbol(),PERIOD_CURRENT,i),low,iTime(Symbol(),PERIOD_CURRENT,0),low);
1011
          ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
1085
          ObjectSetInteger(0,"low",OBJPROP_RAY_RIGHT,true);
1012
          ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
1086
          ObjectSetInteger(0,"low",OBJPROP_COLOR,clrRed);
1013
-         Print("low update due to third condition",low);
1087
+         //   Print("low update due to third condition",low);
1014
         }
1088
         }
1015
      }
1089
      }
1016
 
1090
 
@@ -1212,7 +1286,7 @@ void foo1(int value)
1212
 
1286
 
1213
       //Bos(i);
1287
       //Bos(i);
1214
       //choch(i);
1288
       //choch(i);
1215
-      third_Condition(i);
1289
+      //third_Condition(i);
1216
 
1290
 
1217
 
1291
 
1218
       //      if(signal == "buy" || signal == "sell")
1292
       //      if(signal == "buy" || signal == "sell")
@@ -1356,27 +1430,26 @@ int OnInit()
1356
 
1430
 
1357
 
1431
 
1358
    int idx = 0;
1432
    int idx = 0;
1359
-int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT,inpTime, false);
1360
-if(ObjectCreate(0,"line",OBJ_VLINE,0,inpTime,iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
1361
-  {
1362
-   Print("vertical line created on chart : ");
1363
-  }
1364
-else
1365
-  {
1366
-   Print("error in creating line : ");
1367
-  }
1368
-
1369
-
1370
-   //int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT, D'2022.09.01 15:30:27', false);
1371
-   //if(ObjectCreate(0,"line",OBJ_VLINE,0,D'2022.09.01 15:30:27',iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
1372
-   //  {
1373
-   //   Print("object created on chart : ");
1374
-   //  }
1375
-   //else
1376
-   //  {
1377
-   //   Print("object not created : ");
1378
-   //  }
1379
-     
1433
+//int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT,inpTime, false);
1434
+//if(ObjectCreate(0,"line",OBJ_VLINE,0,inpTime,iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
1435
+//  {
1436
+//   Print("vertical line created on chart : ");
1437
+//  }
1438
+//else
1439
+//  {
1440
+//   Print("error in creating line : ");
1441
+//  }
1442
+
1443
+
1444
+   int user_input_index = iBarShift(Symbol(), PERIOD_CURRENT, D'2022.09.01 15:30:27', false);
1445
+   if(ObjectCreate(0,"line",OBJ_VLINE,0,D'2022.09.01 15:30:27',iLow(Symbol(),PERIOD_CURRENT,user_input_index)))
1446
+     {
1447
+      Print("object created on chart : ");
1448
+     }
1449
+   else
1450
+     {
1451
+      Print("object not created : ");
1452
+     }
1380
    object_find(object_name);
1453
    object_find(object_name);
1381
    if(object_find(object_name) == true)
1454
    if(object_find(object_name) == true)
1382
      {
1455
      {
@@ -1386,7 +1459,7 @@ else
1386
       //
1459
       //
1387
       //      index = iBarShift(Symbol(), PERIOD_CURRENT, time_of_candle1, false);
1460
       //      index = iBarShift(Symbol(), PERIOD_CURRENT, time_of_candle1, false);
1388
 
1461
 
1389
-      Print("candle is ",checkCandle(user_input_index));
1462
+      //  Print("candle is ",checkCandle(user_input_index));
1390
 
1463
 
1391
       if(checkCandle(user_input_index) == "Bullish")
1464
       if(checkCandle(user_input_index) == "Bullish")
1392
         {
1465
         {
@@ -1424,7 +1497,7 @@ else
1424
            {
1497
            {
1425
             if(checkCandle(j) == "Bullish")
1498
             if(checkCandle(j) == "Bullish")
1426
               {
1499
               {
1427
-               Print("bullish found ",iTime(Symbol(),PERIOD_CURRENT,j));
1500
+               //     Print("bullish found ",iTime(Symbol(),PERIOD_CURRENT,j));
1428
                high =  iHigh(Symbol(),PERIOD_CURRENT,j);
1501
                high =  iHigh(Symbol(),PERIOD_CURRENT,j);
1429
                idx = j;
1502
                idx = j;
1430
                break;
1503
                break;
@@ -1449,8 +1522,8 @@ else
1449
       //high = iHigh(Symbol(),PERIOD_CURRENT,user_input_index);
1522
       //high = iHigh(Symbol(),PERIOD_CURRENT,user_input_index);
1450
       //low = iLow(Symbol(),PERIOD_CURRENT,user_input_index);
1523
       //low = iLow(Symbol(),PERIOD_CURRENT,user_input_index);
1451
 
1524
 
1452
-      Print(high);
1453
-      Print(low);
1525
+      //  Print(high);
1526
+      //   Print(low);
1454
       //high_index = user_input_index;
1527
       //high_index = user_input_index;
1455
       //low_index = user_input_index;
1528
       //low_index = user_input_index;
1456
 
1529