Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Gaps in BTC Spot - Different Results

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

    Gaps in BTC Spot - Different Results

    Hello NT Team,

    I was running a backtest on BTCUSD pair, cryptocurrency, I downloaded historical data using "Coinbase", and I get some results for 1 week period test, but when I go to TradingView and I test (The same strategy, same parameters, same timeframe, same EVERYTHING) I get different results, so I dug a bit down to check what is wrong and I found that some candles are missing on NinjaTrader chart, it made a gap, but i don't know really why, could we get gaps on Spot ? and why we get gaps while TradingView is having the same data provider ? which is Coinbase ?

    also I saw that even if I use Trading Hours (Default 24x7) it doesn't trade 24x7 it doesn't trade on weekends, why ? crypto is trading everyday ?

    Thank you


    #2
    Hi Mohammed, thanks for posting. I just tested a 15M BTCUSD chart and I get no gaps in the data on a regular chart, please make sure to stay connected to the Coinbase connection and test a regular 15 minute chart. The CryptoCurrency session template is viewable from Tools>Trading Hours, this session template is a 24/7 time template.

    Kind regards,
    -ChrisL

    Comment


      #3
      Hello Chris, what do u mean with regular chart ?, the chart i sent is the one generated after doing a backtest, and this is the real chart that generated the profit/loss so what do u mean to stay with regular chart, can u tell me in direct exact steps what i should do plz ?

      Thanks

      Comment


        #4
        I just run another backtest here, as u can see, it is skipping Sunday 25 September 2022

        Comment


          #5
          Hi Mohammed, it looks like your computer is not loading the data properly. Please start fresh and delete the data you have already, then connect to the Coinbase connection and try this again. I am getting every day in my test.

          To reset your data:

          Shut down NinjaTrader.
          Open the Documents > NinjaTrader 8 > db folder.
          Delete the sub-folders: "cache" and "Minute".
          Restart NinjaTrader and test.​

          Comment


            #6
            Hello Chris, yes it worked like a charm, thank you

            but I still see biiig difference in profit results between NinjaTrader and TradingView, when I checked a bit in depth, I found that NT ignores sometimes when a crossover or 2 lines is not really big, so it doesn't base a trade on it, while on TV, if a moving average crosses another indicator just by 1 point, it takes it as a cross and trigger the trade, what is the % of tolerance in NinjaTrader in such cases please ?

            Thank you

            Comment


              #7
              Hi Mohammed, to debug this, you will need to use Print() to print out the values being used to the output window or use the databox on the chart. If you see a point on the chart that you want to investigate by looking at the real values of the plots, hold the middle mouse button on your chart and hover over the plot. Here is some documentation on using Print() to debug:



              Kind regards,
              -ChrisL

              Comment


                #8
                Thanks man, your answers were very helpful, I really appreciate it

                Comment


                  #9
                  By the way, have you checked if there are any specific settings or adjustments you could make on NinjaTrader to match TradingView’s 24/7 trading schedule?

                  Comment


                    #10
                    Even though you’re using the same data provider, like Coinbase, each platform processes the data differently, which could explain why TradingView doesn't show the same gaps. Sometimes, trading platforms like NinjaTrader may have specific trading hours or settings that restrict weekend trading, even for crypto.

                    I once had a similar issue when I was backtesting BTCUSD on NinjaTrader. I noticed some gaps, and after digging around, I found that the issue was related to their default trading hours. Once I adjusted them to align with 24/7 crypto trading, the gaps disappeared.
                    Regarding CFTC compliance, it’s worth keeping in mind that regulated platforms have specific rules to ensure the integrity of data and trades. I learned that firsthand when I was exploring different crypto exchanges, and it's definitely something to pay attention to if you’re serious about trading.
                    Last edited by Cheynastro; 01-17-2025, 06:33 AM.

                    Comment


                      #11
                      Originally posted by MohammedAmine View Post
                      Hello NT Team,

                      I was running a backtest on BTCUSD pair, cryptocurrency, I downloaded historical data using "Coinbase", and I get some results for 1 week period test, but when I go to TradingView and I test (The same strategy, same parameters, same timeframe, same EVERYTHING) I get different results, so I dug a bit down to check what is wrong and I found that some candles are missing on NinjaTrader chart, it made a gap, but i don't know really why, could we get gaps on Spot ? Recently implemented a new payment gateway from https://linkpay.io/​ into my business. This helped take payments to a new level. and why we get gaps while TradingView is having the same data provider ? which is Coinbase ?

                      also I saw that even if I use Trading Hours (Default 24x7) it doesn't trade 24x7 it doesn't trade on weekends, why ? crypto is trading everyday ?

                      Thank you
                      Hello,

                      It sounds like you're encountering a few issues with discrepancies between your backtest results on NinjaTrader and TradingView. Let me break it down:
                      1. Missing Candles / Gaps: Gaps can sometimes appear in historical data due to how the data is processed or due to intermittent data availability from the data provider. Even if you're using the same provider (Coinbase in this case), platforms like NinjaTrader and TradingView might handle the data differently, leading to missing candles. In some cases, the data might not have been logged accurately during certain periods. Gaps in spot market data can occur due to various factors such as liquidity issues, market openings and closings, or different trading hours between exchanges.
                      2. Crypto Trading Hours: While cryptocurrency markets are technically open 24/7, platforms like NinjaTrader may have specific trading session times set by default or based on the exchange's data feed. This could cause weekends to be excluded from trading, especially if the trading hours setting is not adjusted correctly. Even though crypto doesn’t "close" like traditional markets, the way NinjaTrader integrates with Coinbase could lead to it not showing weekend data unless the settings are fine-tuned.

                      To address these issues, you might need to:
                      • Check for any available updates or settings in NinjaTrader that could affect how the data is displayed (e.g., trading session times, data provider settings).
                      • Double-check the data source and timeframes on both platforms to ensure they match exactly.
                      • If possible, try reloading or re-importing the data from Coinbase on NinjaTrader to make sure all candles are correctly loaded.

                      I hope this helps clarify the issue! Let me know if you need further assistance.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by NullPointStrategies, Today, 05:17 AM
                      0 responses
                      48 views
                      0 likes
                      Last Post NullPointStrategies  
                      Started by argusthome, 03-08-2026, 10:06 AM
                      0 responses
                      126 views
                      0 likes
                      Last Post argusthome  
                      Started by NabilKhattabi, 03-06-2026, 11:18 AM
                      0 responses
                      66 views
                      0 likes
                      Last Post NabilKhattabi  
                      Started by Deep42, 03-06-2026, 12:28 AM
                      0 responses
                      42 views
                      0 likes
                      Last Post Deep42
                      by Deep42
                       
                      Started by TheRealMorford, 03-05-2026, 06:15 PM
                      0 responses
                      46 views
                      0 likes
                      Last Post TheRealMorford  
                      Working...
                      X