Forums Development Trading made REALLY Simple: Coder's Chat

Viewing 25 posts - 76 through 100 (of 170 total)
  • Author
    Posts
  • #11164
    simplex
    Moderator

      :good:

      I hope to be ready for inspection sometime over the weekend, I’ve entirely rewritten the file parsing and calling function, – now going to look at tidying up the xml file download. (slowly removing all the globals etc :-) )

      I love tidy coding!

      I am unsure how the EventSetTimer in an indicator affects the calling EA

      If the EventSetTimer method of an indicator called by iCustom affects the timer event handling of the calling EA … that would be what I consider a mega-bug. It should not happen.

      But the original plan was (if I’m not wrong) to have not only a news indicator, but to compile it to a callable stand alone function for EA use as well. For such a function, it’s a different kind of story. Inside one EA or indicator, you can only have one timer instance, which is a serious limitation, IMO. I have no idea why those guys at MQ implemented it in such a crappy way.

      If more than one timer is required, it could be done by coding a little multi-instance timer lib … shouldn’t be that complicated.

      s.

      A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

      #11167
      fuzzy
      Participant

        Yes , that’s what I’ve been thinking .  The function is simply called on a as need basis – .  The indicator is purely to show the function working.  The indicator has a timer event implemented by I’ll remove it and run it through the OnCalculate and run a one minute timer of sorts in there.  The lowest possible resolution of the calendar is one minute so there is no need to poll it any faster than that, –  or just before entering a trade.

        A multi-instance timer lib sounds interesting.  I think it could be useful.

        I usually implement a timer of sorts in my EAs -( most of them pre – ver600 ) in an effort to lighten the load on the PC / VPS.

        #11173
        gg53
        Participant

          I think that xux99 implemented a call to FFCAL in his Orcus EA, but not sure.

           

          G.

          #11179
          smallcat
          Participant

            I think that xux99 implemented a call to FFCAL in his Orcus EA, but not sure. G.

            Hi G,

            You are right about this, i found it at Rossbot EA some months ago … tried to change some variables and functions name at that time, but as i tested it after that, i still got so success …  i think i should see it again …

            
            input string                FFCal_settings                   = “———————————————————————-“;
            input bool                  IncludeHigh                        = true;
            input bool                  IncludeMedium                    = true;
            input bool                  IncludeLow                       = false;
            input bool                  IncludeSpeaks                    = true;
            input bool                  ReportAllForUSD               = false;
            
            if (NewsFilter0) {
            t1=1;
            while(t1<=4) {
            OTime[t1]=0;
            t1++;
            }
            MinutesUntilNextEvent=iCustom(Symbol(),PERIOD_CURRENT,”FFCal”,IncludeHigh,IncludeMedium,IncludeLow,IncludeSpeaks,true,0,true,-1,-1,ReportAllForUSD,1,1);
            MinutesAfterPrevEvent=iCustom(Symbol(),PERIOD_CURRENT,”FFCal”,IncludeHigh,IncludeMedium,IncludeLow,IncludeSpeaks,true,0,true,-1,-1,ReportAllForUSD,1,0);
            if (MinutesAfterPrevEvent!=99999) {
            OTime[1]=OTime[22]-(MinutesAfterPrevEvent+MinutesBeforeNews)*PeriodSeconds(PERIOD_M1);
            OTime[2]=OTime[22]-(MinutesAfterPrevEvent-MinutesAfterNews)*PeriodSeconds(PERIOD_M1);
            }
            if (MinutesUntilNextEvent!=99999) {
            OTime[3]=OTime[22]+(MinutesUntilNextEvent-MinutesBeforeNews)*PeriodSeconds(PERIOD_M1);
            OTime[4]=OTime[22]+(MinutesUntilNextEvent+MinutesAfterNews)*PeriodSeconds(PERIOD_M1);
            }
            t1=1;
            while(t1<=4) {
            OTime[t1]*=((OTime[1]>0 || OTime[3]>0) && OTime[1]!=OTime[3]);
            t1++;
            }
            }
            
            

             

            #11180
            smallcat
            Participant

              @simplex,

              Asymmetic ATR channel is interesting … any information how to learn more about it ?

              Thanks in advance ..

              #11183
              simplex
              Moderator

                @smallcat

                Asymmetic ATR channel is interesting … any information how to learn more about it ?

                At the moment only in my brain or on my hard disk. I will post my version later this morning. Stay tuned, please!

                s.

                A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                #11186
                fuzzy
                Participant

                  Attached is the News calendar function and sample indicators.

                  derived from ffcal  ; though I’ve rewritten most of it.

                  No timers are used in this function or indicators anymore.

                  Future version of it should be able to read in past calendar files.

                  the 2 sample indicators:

                  DisplayNews:       as per Emonts, just shows a coloured panel green for all clear, yellow,orange then red for higher impact news.

                  DisplayNewsImpactLine:      Shows a indicator trace on subwindow, indicating impact level, also comment on the top left of current news Item details.  The trace doesn’t load any past data so, set the chart for 1 minute to see the trace add data in real time.  The EA could read from the [0] element of this indicator or call the function itself.

                   

                   

                  Attachments:
                  You must be logged in to view attached files.
                  #11188
                  fuzzy
                  Participant

                    I wish I re-read this forum thread.  I’ve only now seen your comments on file sharing and web access aspect of the newscal..  I’ll look at this aspect over the weekend.  Should be simple enough, using the MQL’s   GlobalVariables with some sort of random time init to grab control of the web downloading. etc.

                    #11189
                    simplex
                    Moderator

                      Great one:

                      Attached is the News calendar function and sample indicators.

                      You announced tidy code … I found tidy code. I really appreciate that! :good:

                      Just one little remark about your input dialog – see pics. Your internal remarks (30, 15) are not very informative on the user’s side. I would suggest to replace

                      sinput int minutesBeforeNews = 150;//30
                      
                      sinput int minutesAfterNews = 500;//15

                      by

                      sinput int minutesBeforeNews = 150;            // minutes before news
                      
                      sinput int minutesAfterNews = 500;            // minutes after news

                      s.

                      Attachments:
                      You must be logged in to view attached files.

                      A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                      #11192
                      simplex
                      Moderator

                        @fuzzy:

                        I wish I re-read this forum thread. I’ve only now seen your comments on file sharing and web access aspect of the newscal.. I’ll look at this aspect over the weekend.

                        Looking at the way you’re addressing the ‘news problem’ makes me feel confident that everybody can relax now about this topic. It’s obviously in good hands!

                        :good:

                        Enjoy your weekend … looking forward to your further contributions!

                        s.

                        A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                        #11195
                        gg53
                        Participant

                          On Currency-Strength:

                          Since we are going to use Currency-Strength as part confirmation for Entry/Exit, I’d like to share my view on the subject of Currency Market Share.

                          I already introduced the USDx, which is the Dollar Index, based on US Trade basket of US trade partners currencies, and the way it’s calculated.

                          I’m using the same calculation method to create my own FX USDx Index – but this one is more adapted to the Forex market.

                          The Data:

                          FX Market Share by Major Currency (%):
                          ————————————————-
                          USD:     87.0 -> 49.5465
                          EUR:     33.4 -> 19.0213
                          JPY:      23.0 -> 13.0985
                          GBP:     11.8 -> 6.7201
                          CHF:      8.6 -> 4.8977
                          CAD:      5.2 -> 2.9614
                          AUD:      4.6 -> 2.6197
                          NZD:      2.0 -> 1.139
                          ————————
                          Total %: 175.6 / 2 = 87.8 * 1.139 = 100%

                          * Because two currencies are involved in each transaction,  the sum of percentage share of individual currencies totals 200 percent.
                          We devide the total by 2, and modify the result to 100% using a calculated factor of 1.139.
                          Now we devide each currency % by 2 and multiply it by the factor to get its FX Majors market share.

                          What you have after the “->” is the currency % share AFTER such calculation.
                          ————————————————————————————————————————————————————

                          FX Market Share by Major Currency pair (%):
                          ——————————————————
                          USD/EUR     24.1
                          USD/JPY     18.3
                          USD/GBP      8.8
                          USD/AUD      6.8
                          USD/CAD      3.7
                          USD/CHF      3.4
                          USD/NZD      1.5

                          EUR/JPY       2.8
                          EUR/GBP      1.9
                          EUR/CHF      1.3
                          ——————————————————————————————————————————

                           

                          Now you can create your own FX USDx , based on the same calculation method as in the original USDx, which is more adapted to Forex market Major currencies and pairs.

                           

                          G.

                           

                           

                          #11196
                          simplex
                          Moderator

                            @gg53:

                            Thank you for sharing your model! I tried to understand it and compiled your numbers into a spreadsheet – see attachment. I’m getting slighly different numbers, maybe I misunderstand some detail.

                            USD/EUR     24.1 vs. 27.2
                            USD/JPY      18.3 vs. 18.7
                            USD/GBP      8.8 vs. 9.6
                            and so forth …

                            Could you give me some feedback regarding the spreadsheet attached?

                            s.

                            Attachments:
                            You must be logged in to view attached files.

                            A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                            #11216
                            gg53
                            Participant

                              @gg53: Thank you for sharing your model! I tried to understand it and compiled your numbers into a spreadsheet – see attachment. I’m getting slighly different numbers, maybe I misunderstand some detail. USD/EUR 24.1 vs. 27.2 USD/JPY 18.3 vs. 18.7 USD/GBP 8.8 vs. 9.6 and so forth … Could you give me some feedback regarding the spreadsheet attached? s.

                              Those numbers are from the BIS (The Bank for International Settlements), and NOT calculated.

                              Their sum is 66.6%, and I scale them to 100% and calculate each pair by that factor.

                              I use in both a Stand-Alone USDx indicator and my Spaghetti indicator.

                              I never trade AGAINST the USDx indie.

                               

                              G.

                              #11217
                              simplex
                              Moderator

                                Ok, thank you! That upscaling will obviously be trivial. I assume the numbers are from this report (p. 5).

                                But after that step I’m afraid we might get stuck at a similar point of discussion like weeks ago, when we failed to define a common view about the proper algorithm to implement those numbers.

                                At the moment I’m having no new idea regarding that detail. So maybe I’ll step back for a while and hope somebody else with a clever idea might show up from his or her hideout.

                                s.

                                A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                #11218
                                gg53
                                Participant

                                  Ok, thank you! That upscaling will obviously be trivial. I assume the numbers are from this report (p. 5). But after that step I’m afraid we might get stuck at a similar point of discussion like weeks ago, when we failed to define a common view about the proper algorithm to implement those numbers. At the moment I’m having no new idea regarding that detail. So maybe I’ll step back for a while and hope somebody else with a clever idea might show up from his or her hideout. s.

                                  Here are my USDx with and without (Plain) market share.

                                  Note that USDx weighted indicator is currently pointing up (correct) while the other one is pointing slightly down (current Friday close).

                                  I use the weighted one for my ForexGT_Spaghetti CS indicators.

                                  Just replace the std. USDx in your CIX calculations with this one (or similiar method) and you are on the right way.

                                   

                                  G.

                                  Attachments:
                                  You must be logged in to view attached files.
                                  #11224
                                  smallcat
                                  Participant

                                    Here are my USDx with and without (Plain) market share. Note that USDx weighted indicator is currently pointing up (correct) while the other one is pointing slightly down (current Friday close). I use the weighted one for my ForexGT_Spaghetti CS indicators. Just replace the std. USDx in your CIX calculations with this one (or similiar method) and you are on the right way. G.

                                    Thanks a lot G.  :good:


                                    @simplex
                                    : Thanks for your zip file  :good:

                                    @fuzzy : Thanks for NewsCal code  :good:

                                    #11225
                                    fuzzy
                                    Participant

                                      Hi all

                                      This is a new version of the New Calendar function +.

                                      • File sharing / locking done.
                                      • Web access locking done.
                                      • Locks clearing protocol .
                                        • Calendar history loading implemented. (see displayNewsImpactLine indicator)
                                          on indicator chart,
                                          -1 – no history
                                          0  – no news
                                          1 – low impact
                                          2 – med impact
                                          3 – high impact

                                      Calendar files will get saved in the Files folder as expected.

                                      I have included this weeks calendar file as a start to the history bank should you desire.

                                       

                                      Simplex:   I had no idea that the comments on the sinput line get displayed that way.  Thanks for that.   :good:

                                      I could improve the way loading history works, currently it reads the file each access.  I’ll think about that tomorrow.

                                       

                                      Attachments:
                                      You must be logged in to view attached files.
                                      #11227
                                      fuzzy
                                      Participant

                                        What the DisplayNewsCalendarImpactLine  indicator looks like (loading history bars)

                                        the image shows with the trace at -1 (no history)  then the different impact levels

                                        • This reply was modified 10 years, 4 months ago by fuzzy.
                                        • This reply was modified 10 years, 4 months ago by fuzzy.
                                        Attachments:
                                        You must be logged in to view attached files.
                                        #11232
                                        gg53
                                        Participant

                                          fuzzy,

                                          Thanks a lot !!

                                           

                                          G.

                                          #11234
                                          Lowphat
                                          Participant

                                            On Currency-Strength:  USD/EUR 24.1 USD/JPY 18.3 USD/GBP 8.8 USD/AUD 6.8 USD/CAD 3.7 USD/CHF 3.4 USD/NZD 1.5 EUR/JPY 2.8 EUR/GBP 1.9 EUR/CHF 1.3 ——————————————————————————————————————————  

                                            fun bar based index which i tried to add your weights. (  sorry if this is a tad off topic :)  )

                                            Attachments:
                                            You must be logged in to view attached files.

                                            “I believe the very best money is made at the market turns. Everyone says you get killed trying to pick tops and bottoms and you make all
                                            your money by playing the trend in the middle. Well for twelve years I have been missing the meat in the middle but I have made a lot of
                                            money at tops and bottoms.”
                                            – Paul Tudor Jones

                                            #11237
                                            simplex
                                            Moderator

                                              @fuzzy:

                                              I had no idea that the comments on the sinput line get displayed that way.

                                              Note that this only works with #property strict set, otherwise the variable name will be displayed. I like that feature because it provides much more freedom to design a good user interface in the input dialog.

                                              Thanks for your new version. Your description sounds more than good and I will check it out during the weekend!

                                              s.

                                              A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                              #11238
                                              simplex
                                              Moderator

                                                Just replace the std. USDx in your CIX calculations with this one (or similiar method) and you are on the right way.

                                                Thanks, will give it a try!

                                                s.

                                                A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                                #11243
                                                gg53
                                                Participant

                                                  Just replace the std. USDx in your CIX calculations with this one (or similiar method) and you are on the right way.

                                                  Thanks, will give it a try! s.

                                                  The numbers I used in this indicator are from “Global foreign exchange market turnover by currency pair”, Table #3 – from here: http://www.bis.org/publ/rpfx13fx.pdf.

                                                   

                                                  G.

                                                  #11244
                                                  simplex
                                                  Moderator

                                                    Ok, first of all I tried to get a grip on your ‘never trade against it’ rule, and failed. Maybe it’s just my noob interpretation of what that rule really means.

                                                    Some USD based examples on H4, showing your plain and USDx version of ForexGT Dollar Index.

                                                    • AUDUSD: nearly perfect, but the reversal at the right end seems to be better resolved by the ‘plain’ version.
                                                    • EURUSD: not so perfect, looking at the left end, perfect for the rest. And again: the reversal at the right end is better resolved by the ‘plain’ version.
                                                    • GBPUSD: absolutely perfect.
                                                    • USDCAD: nearly perfect, but the reversal at the right end appears to be better resolved by the ‘plain’ version.
                                                    • USDJPY: trend lines on the indicators are contrary to price trend.

                                                    You seem to be very confident about your rule, so my simple interpretation is probably wrong. What does ‘never trade against it’ really mean?

                                                    s.

                                                    • This reply was modified 10 years, 4 months ago by simplex. Reason: Correction of USDJPY discussion!
                                                    Attachments:
                                                    You must be logged in to view attached files.

                                                    A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                                    #11251
                                                    simplex
                                                    Moderator

                                                      Yes:

                                                      The numbers I used in this indicator are from “Global foreign exchange market turnover by currency pair”, Table #3 –

                                                      The same link as mine – thanks for confirming!

                                                      s.

                                                      A good trader is a realist who wants to grab a chunk from the body of a trend, leaving top- and bottom-fishing to people on an ego trip. (Dr. Alexander Elder)

                                                    Viewing 25 posts - 76 through 100 (of 170 total)
                                                    • You must be logged in to reply to this topic.
                                                    Scroll to Top