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

How to create macro to turn on/off autoscaling?

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

    How to create macro to turn on/off autoscaling?

    Hi all - new to NT macro writing, could use some help starting out, with a simple chart macro:

    * Chart has autoscale turned on for price bars, so they're always in view...
    * I have a moving average on the chart.
    * Normally, I run with autoscale turned on, so the moving average is always visible.
    * However, when price action moves a long distance away, the moving average autoscaling scrunches up the price bars a lot, so it's hard to read the price action.

    I can manually adjust the price axis to un-scrunch the price bars, but thought I'd take a stab at writing some sort of macro that would allow me to toggle the moving average autoscaling on/off. Maybe setup a hotkey combo that would invoke the macro, too.

    If there's a way to check the $.01 distance of the moving average from the current price bar and use that as a basis for toggling the autoscaling, that might work, too.

    I have a lot of programming/computer experience, but zero NT macro experience...

    So, can anyone point me somewhere to start on this or perhaps lay a chunk of code on me to get me started?

    Thanks...

    #2
    Hello,

    Thank you for the question.

    There are actually no Macros in NinjaTrader, you can assign key commands to certain functions but what you are wanting to do would be something of a third party application that does macros.

    The only process to Disable or Enable autoscale would be to use the indicators property menu, or to set this in script from the indicator its self.



    The only supported usage of AutoScale from script would be from within Initialize, but you could certainly try using it in OnBarUpdate in your conditions to change the autoscale. This would be if you created an Indicator that checks the Price and the MA to see how far apart they are.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response. I'll investigate your suggestions.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Touch-Ups, Today, 10:36 AM
      0 responses
      1 view
      0 likes
      Last Post Touch-Ups  
      Started by geddyisodin, 04-25-2024, 05:20 AM
      8 responses
      61 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by jxs_xrj, 01-12-2020, 09:49 AM
      4 responses
      3,289 views
      1 like
      Last Post jgualdronc  
      Started by Option Whisperer, Today, 09:55 AM
      0 responses
      5 views
      0 likes
      Last Post Option Whisperer  
      Started by halgo_boulder, 04-20-2024, 08:44 AM
      2 responses
      22 views
      0 likes
      Last Post halgo_boulder  
      Working...
      X