Browse Source

Ticket: 5172 Complete

Huzaifa-MQLDev 4 months ago
parent
commit
c11b7e8b9e

BIN
library/volHedgeNewsFilter.ex5


+ 10 - 4
library/volHedgeNewsFilter.mq5

@@ -79,10 +79,13 @@ datetime lastNews;
79 79
 //+------------------------------------------------------------------+
80 80
 //|                                                                  |
81 81
 //+------------------------------------------------------------------+
82
-void initiateNews() export
82
+void initiateNews(bool isMaster = false) export
83 83
   {
84 84
    lastNews=TimeCurrent();
85
-   updateNews();
85
+   if(isMaster == true)
86
+     {
87
+      updateNews();
88
+     }
86 89
    fillNewsStruct();
87 90
    Print("The Symbol is:",Symbol()," and timeperiod:",Period()," and file name is:"+fileName);
88 91
   }
@@ -120,6 +123,7 @@ int returnNewsStatus(bool highFlag=true
120 123
                      ,int gmt=2
121 124
                      ,selectLine sl=0
122 125
                      ,string extraSymbol=""
126
+                     ,bool isMaster = false
123 127
                     ) export
124 128
 //+------------------------------------------------------------------+
125 129
 //|                                                                  |
@@ -139,7 +143,10 @@ int returnNewsStatus(bool highFlag=true
139 143
      {
140 144
       if(TimeDayMQL4(TimeCurrent())!=TimeDayMQL4(lastNews))
141 145
         {
142
-         updateNews();
146
+         if(isMaster)
147
+           {
148
+            updateNews();
149
+           }
143 150
          fillNewsStruct();
144 151
          lastNews=TimeCurrent();
145 152
          Print("News Function is calling and updating by "+symbol);
@@ -768,7 +775,6 @@ string returnUpCommingNews(bool highFlag=true,
768 775
 
769 776
       if(TimeDayMQL4(TimeCurrent())!=TimeDayMQL4(lastNews))
770 777
         {
771
-         //updateNews();
772 778
          fillNewsStruct();
773 779
          lastNews=TimeCurrent();
774 780
          Print("News Function is calling and updating by "+symbol);

BIN
vol_hedge_strategy_mt5.ex5


BIN
vol_hedge_strategy_mt5.mq5