Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pricing of Forex – determining programmatically?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Pricing of Forex – determining programmatically?

    NT Support,

    Could I get some advice please?

    Is there a means by which one can programmatically determine (other than looking at the text format of the string) what is the pricing structure of an instrument? I am specifically referring here to Forex, but I think it probably refers to any instrument.

    The case I’m dealing with at the moment is a change between brokers with one of them pricing in standard pip sizing (i.e. 0.0001 for GBPUSD) and the other dealing with 1/10th pip sizing (i.e. 0.00001 for GBPUSD).

    See related threat here with example code on determining tick size: http://www.ninjatrader.com/support/f...ad.php?t=35935


    Thanks and regards,

    drolles

    #2
    Hi drolles, no the text formatting given by the string would be the way to go, I'm unfortunately not aware of another way...

    Comment


      #3
      Bertrand,

      Thanks very much for the prompt reply and the clarification on best practice.

      Thanks and regards,

      drolles

      Comment


        #4
        Bertrand,

        Thanks for your help. I’m finding other challenges with this now. Could you please help me?

        As you already know the code I’m referring to, I will skip over the introduction.

        I’ve recently move broker and I’ve been having some problems with MB Trading. Previously, in testing and with PFG Best I have been pricing currency in Pips. I’m now working with MB Trading and they price their currency in 1/10th of a pip. Therefore, I’ve set the currency to price in that.

        With testing I’ve been running debugging with VS (Std 2008) and have captured the screen shot of TickSize.ToString().Length == 5 being returned when running against AUDUSD. When pricing in a 1/10th of a pip I thought that TickSize.ToString().Length function should return 7. That is 0.00001, given we are talking about text representation here the dot / decimal place counts as one. I have captured this in a screen shot from VS.

        With further testing, I’ve tried to change “Quote currencies (FX) in:” NT crashed. After a restart, I set this to “Pip” and reran AUDUSD (second screen shot attached).

        Could I please check if there is any functionality interaction here between Round2TickSizewhich is used in the calling method which calls from the MasterInstrument namespace and the TickSize method? I don’t know if this is possibly a red herring.

        Thanks and regards,

        drolles
        Attached Files

        Comment


          #5
          Dan, for the crash you experienced - could you please forward me the trace and logs for review?

          When I check the AUDUSD on MBT TenthPip setting I see 6 being returned for it - please check in your Control Center for the Level 1 stream received from the MBT Navigator.

          Comment


            #6
            Bertrand,

            Thanks very much for your reply.

            Happy New Year.

            As per the request I’ve forward over the trace file.

            With regards to the problem of getting the correct return value from the function mentioned below. I’ve tested this again and come up with the same result (see screen shots with respective names for instruments). As you can see it is returning 5 in both cases.

            Just to make sure I understand what you are saying with regards to the settings regarding MB. You refer below to “Level 1”. I have obviously set my Control Centre to price in 1/10th pip in the Control Centre -> Options -> Data Tab -> Quote currencies in:. Is there some other setting I need to adjust?

            Just had a through while pulling this reply together: What happens when data previously pulled down from another source (e.g. Esignal) which prices Forex in pips, then that data is used for 1/10th pricing? My historical data is from Esignal and not from MB Trading.

            Thanks and regards,

            drolles
            Attached Files

            Comment


              #7
              Dan, thank you - Happy New Year to you as well - the checking of the Level 1 data you get while connected to MBT would be only feasible in realtime, so you can check with data MBT would 'drive' to you. If you change brokers and change the pip settings > this will not backadjust previously stored / downloaded data so it would be best if you download fresh backtesting data with the pip settings as needed in place and then recheck your results. I feel this is the issue you run into here.

              Thanks,

              Comment


                #8
                Bertrand,

                Thanks for the reply.

                Though, this is not good news at all.

                I’ve got years to historical data in traditional format (i.e. pips) that is no longer compatible with the settings for pricing Forex data when connected to MB. This is a big problem! Any suggestions on workarounds?

                We also need to get something on the development log; I find it hard to believe that I’m the only person having a data feed from their broker and historical data priced in different format. NT should really be more robust than this, it has cost me a number of days of checking and rechecking. I would suggest this is a big problem for anyone seriously trying to backtest / trade Forex strategies.

                Do you know where I can find out how much historical data MBT hold on their demo / live servers? I’ve done a search of their site and come up blank.

                Thanks and regards,

                drolles

                Comment


                  #9
                  Bertrand,

                  Further testing; you are right. I’ve try to put a strategy live and had the results in the screen shot. The first call based on historical data was incorrect returning 5 as a result to the TickSize string return function. The second call, based on “live data” being driven by MBT it has calculated the position size correctly, whereby returning 7 from the TickSize string property test.

                  Again, I would greatly appreciate if NT could recommend a workaround.

                  Also, additional questions with this functionality.

                  I’ve now probably got a mix of data priced in pips and 1/10th pip across a number of installations of NT. What will be the functionality going forward with backtesting against this data when the pricing is set to standard pips and 1/10th pip? What will be returned as the TickSize? I’m now worried about the contamination of historical data.

                  Thanks and regards,

                  drolles
                  Attached Files

                  Comment


                    #10
                    drolles, the historical data is not changed by NT - however if you reload it from the MBT servers it would be replaced by their data, which could differ in the world of FX spot trading due to it's decentralized nature. You would need to check with your MBT broker to be 100%, but from my experience minute data should be available for at least 6 months from them.

                    Comment


                      #11
                      Bertrand,

                      Ok, thanks very much for your reply.

                      So what is the recommendation here? Should I be deleting the last month of data to try to get the MBT’s data in so the strategies can be put live with the correct position size? In the testing I had position size errors thrown up by NT saying that I had oversized the position (unsurprisingly).

                      Also, what would happen with the backtesting question I posed in the earlier post? Should I have a testing set of a data (so that position sizing works) which will be different to the live set of data?

                      Do you think this problem requires escalation?

                      Thanks and regards,

                      drolles

                      Comment


                        #12
                        drolles, this is working as expected, you unfortunately run into a limitation here - you should trade and backtest FX spot strategies on the data from your broker, since different pricings and pip settings could skew results otherwise as you had seen. If you visually inspect the data and it's a close enough match for you, you could probably add code to change the position sizing formula to reflect when you started working with data MBT using another pip setting so the ticksize length change is interpreted correctly.

                        Comment


                          #13
                          Bertrand,

                          Thanks for the response.

                          Nothing personal, I think you are one of the best people on this support forum, but I think that is a woefully inadequate response and approach to what appears to be a fundamental floor in what should be core functionality. You are basically suggesting that hundreds of pounds spend on historical data and countless hours coding strategies should be thrown out because NT can’t handle forex pricing formats. You really cannot expect that to be an acceptable answer?

                          Can you please describe the escalation path here – both technical and managerial? Sorry, but I think that given the rates of response on this and the answers I’m getting this needs some attention from management. I am not really seeing a sense of urgency here at all. Please understand this is stopping me getting strategies live!

                          Can you please be crystal clear in what you are recommending with regards to a work around? If you are suggesting coding a date checking method, sorry but I don’t really see that as an answer, not without some serious error handling. If you are suggesting that I would expect someone from NT to (at a minimum) suggest some framework code.

                          Should we not investigate while 5 is being returned in those circumstances? Who knows this code best? Has this problem been replicated by the support team there? What actions have been taken to troubleshoot this with the development / support team?

                          One possible workaround in the short-term could be to:

                          1. Delete the last 3 months of data from the NT database
                          2. Reload them from MBT’s servers (in 1/10th pip format)
                          3. Given this the strategies should be calculating position size correctly
                          4. Put the strategies live

                          However, I still don’t have an answer on what effects this would have on:

                          1. Having 1/10th pip priced data mixed with pip priced data while having the pricing of Forex set to pips (what would be returned – are we going to see problems the other way?)
                          2. Keep MBT data on a separate live machine / install of NT (for live trading) and use pip priced data for backtesting / development

                          (Reference above as to why your suggestions above regarding backtesting on MBT’s data – they only hold 6 months as opposed to years – are unacceptable)

                          I have already phoned customer service for MB, they open at 8:30am EST. I will contact them then to see if they have any suggestions.

                          Sorry if frustration is boiling over but I really don’t feel that this is being given the attention it deserves.

                          Thanks and regards,

                          drolles

                          Comment


                            #14
                            drolles, I'm sorry for frustrations experienced getting this to work the way you envisioned - I would not have a dedicated reference sample at hand, but if the strategies knows when you're switching to data with MBT's tenthPip granularity you would be able to work it into your PositionSize algorithm determing the length of the string of the data ticksize. If you need to switch brokers regularly, two NT7 installs would be best to cater this setup - if you prefer to discuss with me personally, please send me a note to support at ninjatrader dot com and I'm happy to give you a call later this PM.

                            Thanks,

                            Comment


                              #15
                              Hi Dan,

                              I had an issue with this too although it wasn't nearly so fundamental to my strategies. I would suggest just not using the number of ticks. Base it on price, and if necessary hard code the tick size / price increment against the instrument name.

                              HTH although I expect it's not exactly inspiring to hear.

                              Regards

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              581 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              336 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              103 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              554 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              552 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X