Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strange Market behavior

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

    Strange Market behavior

    Dear all,

    I would like to ask about these chart cases:

    The Target Level is set to be around $500 , and in these 3 trades the Targets exceeded $500.​

    Click image for larger version  Name:	TinyTake22-09-2022-11-57-51.png Views:	0 Size:	292.6 KB ID:	1216754

    - is it normal? or is the downloaded data corrupted ?
    - If it is normal, how to handle these situations.​

    Regards,
    Last edited by PrQuantumH; 09-23-2022, 09:53 AM.

    #2
    Hello PrQuantumH,

    Thanks for your post.

    This would likely depend on what you are using in your code for the profit target order.

    So I may accurately assist, how are you creating the profit target order in your code?

    For example, are you using the Managed Approach or Unmanaged Approach?

    Does your strategy use Set methods (SetProfitTarget()), Exit methods (like ExitLongLimit()), or SubmitOrderUnmanaged() from the Unmanaged Approach?

    If you are using Set methods, are they called only in OnStateChange()? Or, are the called in OnBarUpdate() also?

    If possible, please share a copy of your script so I may review how the profit target is programmed.

    I look forward to further assisting.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hi Brandon Thank you.

      - I'm using the Unmanaged Approach.
      - SubmitOrderUnmanaged() has been used on OnExecutionUpdate.
      - The code is correctly placing the TP/SL , but only on that date it get that large TP Error..

      Is it possible that during that specific time there were no ASK/BID for few candles ?

      Below is the BUY Target/Stop code inside the OnExecutionUpdate section.

      Click image for larger version

Name:	0021021.png
Views:	142
Size:	100.3 KB
ID:	1216773


      Regards,

      Comment


        #4
        Hello PrQuantumH,

        Thanks for that information.

        I do not see anything specific in the code you shared that would cause the strategy to behave as you are reporting.

        Ultimately, debugging prints would need to be added to the strategy to determine exactly how the strategy is submitting the profit target order and how that order is being filled at the specific time(s) mentioned.

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.

        https://ninjatrader.com/support/foru...121#post791121

        Let us know if we may assist further.​
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hi Brandon, Thank you.

          - I think there is no error in the code.
          - My question is : Why the chart is looking like that , (1) too many small candles, (2) then the candle started very far away

          Date of the trades : Mar 9, 2020

          Click image for larger version  Name:	002101.png Views:	0 Size:	110.9 KB ID:	1216809

          Regards,
          Last edited by PrQuantumH; 09-23-2022, 02:58 PM.

          Comment


            #6
            Hello PrQuantumH,

            Thanks for your note.

            " I think there is no error in the code."

            To know for sure if there are issues with the logic of your strategy and exactly how it is submitting orders, you must add debugging prints to the strategy to understand how it is behaving.

            Below is a link to a forum post that demonstrates how to use prints to understand behavior.

            https://ninjatrader.com/support/foru...121#post791121

            "Why the chart is looking like that , (1) too many small candles, (2) then the candle started very far away:"

            This could be due to the historical data that you downloaded for that instrument on that date. Something you could consider is re-downloading the historical data by going to Control Center > Tools > Historical Data > Load tab. After re-downloading the historical data for the instrument and dates you are backtesting on, please test the strategy to see if the behavior persists.

            See this help guide page for information about downloading historical data: https://ninjatrader.com/support/help...8/download.htm

            See this help guide page for details about backtesting with the Strategy Analyzer: https://ninjatrader.com/support/help...a_strategy.htm

            Let me know if I may assist further.
            <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

            Comment


              #7
              Thank you Brandon,

              - I have repeated downloading the data, and the same issue is still there.

              Do you think this is because of a Rollover merging situation OR a Market crash situation ?

              Regards,

              Comment


                #8
                Hello PrQuantumH,

                Thanks for your note.

                What is your 'Global merge policy' set to in the Market Data tab of the Options window? Go to Control Center > Tools > Options > Market data tab and note the 'Global merge policy' setting.

                What is your 'Merge policy' set to for those instruments in the Instruments window? Go to Control Center > Tools > Instruments > double-click on the instrument(s) you see this behavior occurring on > and note the 'Merge policy' setting.

                Please also go to Control Center > Tools > Instruments > double-click on the instrument(s) you see this behavior occurring on > select the 'Contract months' field > click the 03-22 rollover date ad note the 'Offset' field. Does the Offset field say 'N/A' or does the Offset field contain a number (such as -87)?

                I look forward to assisting further.
                <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                50 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
                69 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