Huzaifa-MQLDev месяцев назад: 4
Родитель
Сommit
c11b7e8b9e
4 измененных файлов с 10 добавлено и 4 удалено
  1. BIN
      library/volHedgeNewsFilter.ex5
  2. 10 4
      library/volHedgeNewsFilter.mq5
  3. BIN
      vol_hedge_strategy_mt5.ex5
  4. BIN
      vol_hedge_strategy_mt5.mq5

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

BIN
vol_hedge_strategy_mt5.ex5


BIN
vol_hedge_strategy_mt5.mq5