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 cycle or randomize my drawing templates?

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

    How to cycle or randomize my drawing templates?

    I have a bunch of trend channel templates with different colors that I created and I want to either cycle or randomize the color template that's used whenever I draw trend channels instead of always using the default template. I'm fairly certain it can be done by editing the code but I am an absolute beginner at coding and was looking for some tips. I am on NinjaTrader 8.

    Thanks

    #2
    Hello yuenster,

    Thank you for your post.

    If you would like to randomly select a Trend Channel drawing tool template or select a drawing tool template from a list of existing templates, you would need to use C# methods, such as Directory.GetFiles or Path.GetFileNameWithoutExtension, to get the list of the files in the folder Documents\NinjaTrader 8 \templates\DrawingTool\TrendChannel. Then you would read each file name to get the TrendChannel template name.

    Please note we do not provide C# programming education services in our Support department. That said, you may find the publicly available links below to be helpful.


    Returns the file name without the extension of a file path that is represented by a read-only character span.


    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by wzgy0920, Yesterday, 09:53 PM
    2 responses
    49 views
    0 likes
    Last Post wzgy0920  
    Started by Kensonprib, 04-28-2021, 10:11 AM
    5 responses
    191 views
    0 likes
    Last Post Hasadafa  
    Started by GussJ, 03-04-2020, 03:11 PM
    11 responses
    3,230 views
    0 likes
    Last Post xiinteractive  
    Started by andrewtrades, Today, 04:57 PM
    1 response
    14 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by chbruno, Today, 04:10 PM
    0 responses
    7 views
    0 likes
    Last Post chbruno
    by chbruno
     
    Working...
    X