Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

OnMarketData Updates using DrawTextFixed

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

    OnMarketData Updates using DrawTextFixed

    Hi,

    I am after any suggestions as to how I can use DrawTextFixed within OnMarketData to display the most recent updates to bid ask last? I have attempted ChartControl.Refresh however there still appears to be a difference of 1 update. When using Print the updates are of course being seen as expected.

    Regards,
    suprsnipes

    #2
    Hello suprsnipes,

    Thank you for writing in.

    You shouldn't need to do anything except utilizing DrawTextFixed() to update your text as every call of OnMarketData() will call DrawTextFixed() again.

    I've provided a script sample that demonstrates this. The sample displays both bid and ask on the chart and it matches the bid and ask updates on the Chart Trader.

    If this is not the case with your own script, can you please provide your script so I may test on my end?

    To export your script do the following:
    1. Click File -> Utilities -> Export NinjaScript
    2. Enter a unique name for the file in the value for 'File name:'
    3. Select the strategy from the objects list on the left -> click the right facing arrow ">" to add the strategy to the export
    4. Click the 'Export' button -> click 'yes' to add any referenced indicators to the export -> click OK to clear the export location message


    By default your exported file will be in the following location:
    • (My) Documents/NinjaTrader 7/bin/Custom/ExportNinjaScript/<export_file_name.zip>


    Below is a link to the help guide on Exporting NinjaScripts.
    http://www.ninjatrader.com/support/h...nt7/export.htm
    Attached Files
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks for your response. Add e.Volume to your code and you will see what I am referring too.

      suprsnipes.

      Comment


        #4
        Hello suprsnipes,

        Thank you for the additional information.

        You'll want to lower your chart's display update interval. This specific property can be found by right-clicking in your chart and selecting Properties.

        This property will be within the Window category. Please note that a value of 200 ms or less (0.2) will be CPU intensive and can adversely affect performance especially in high volatile market activity.

        For more information about the chart properties window, please take a look at the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG...properties.htm

        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Thanks I have tried this also, same outcome 1 update behind.

          Comment


            #6
            Hello suprsnipes,

            For additional clarification, can you please provide a video of the behavior that you are seeing?

            Here is a link to a third party software called Jing that would allow you to record a video: https://www.techsmith.com/jing.html
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by andrewtrades, Today, 04:57 PM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by chbruno, Today, 04:10 PM
            0 responses
            6 views
            0 likes
            Last Post chbruno
            by chbruno
             
            Started by josh18955, 03-25-2023, 11:16 AM
            6 responses
            436 views
            0 likes
            Last Post Delerium  
            Started by FAQtrader, Today, 03:35 PM
            0 responses
            7 views
            0 likes
            Last Post FAQtrader  
            Started by rocketman7, Today, 09:41 AM
            5 responses
            19 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X