NexusFi: Find Your Edge


Home Menu

 





Code to programatically save and load indicator properties (templates) in NT8


Discussion in NinjaTrader

Updated
    1. trending_up 1,562 views
    2. thumb_up 2 thanks given
    3. group 2 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
 b16aln 
London
 
Experience: None
Trading: ftse100
Posts: 67 since Sep 2017
Thanks Given: 11
Thanks Received: 24

Hello,

As the title suggests I am looking for some code that I can use in my indicator to save and load the indicator properties to external xml files. As is generally my experience with nt8 support, they were unhelpful and refused to share the code to do this (https://discourse.ninjatrader.com/forum/ninjatrader-8/indicator-development/1218493-code-to-save-and-load-indicator-templates)...so I am reaching out for some guidance here as I have no experience of xml and how to get it into the nt8 format. Loading and saving templates seems like such a common requirement that there must be many users that have already worked out and implemented this so hoping someone can share the code before I have to go balls deep into researching/implementing it.

I searched high and low and found this thread relating to nt7: . I don;t really understand what is going on with this example or how to translate it to nt8 but it seems to be generally what I am looking for.

If anyone can help it would be much appreciated.


Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Bitcoin’s 2022 low, 2025 high and 2026 low so far arou …
Cryptocurrency
requesting .nrd replay files from 2026 spy and qqq
The Elite Circle
Building a free browser DOM/SMC simulator - need some ad …
Platforms and Indicators
My Rant with AMP Futures
Trading Reviews and Vendors
No book, only a stair: journaling fills where price move …
Cryptocurrency
 
  #2 (permalink)
 
trendisyourfriend's Avatar
 trendisyourfriend 
Quebec Canada
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG
Trading: ES, NQ, YM
Frequency: Daily
Duration: Minutes
Posts: 4,581 since Oct 2009
Thanks Given: 4,267
Thanks Received: 6,212


b16aln View Post
Hello,

As the title suggests I am looking for some code that I can use in my indicator to save and load the indicator properties to external xml files. As is generally my experience with nt8 support, they were unhelpful and refused to share the code to do this (https://discourse.ninjatrader.com/forum/ninjatrader-8/indicator-development/1218493-code-to-save-and-load-indicator-templates)...so I am reaching out for some guidance here as I have no experience of xml and how to get it into the nt8 format. Loading and saving templates seems like such a common requirement that there must be many users that have already worked out and implemented this so hoping someone can share the code before I have to go balls deep into researching/implementing it.

I searched high and low and found this thread relating to nt7: . I don;t really understand what is going on with this example or how to translate it to nt8 but it seems to be generally what I am looking for.

If anyone can help it would be much appreciated.

I have created a routine to read an XML file in my strategy. I used it to read the current ATM template selected in the Chart Trader.

Here is an example i have done for you (took it from my strategy).
https://pastecode.io/s/23zsmphb

Don't forget to add these lines at the top of your script:
using System.Xml.Serialization;
using System.Xml;


Reply With Quote
Thanked by:
  #3 (permalink)
 b16aln 
London
 
Experience: None
Trading: ftse100
Posts: 67 since Sep 2017
Thanks Given: 11
Thanks Received: 24


Thank you my friend! That's excellent and very good of you to help me out. I'll go over it properly on Monday and try to implement it next week. Thanks agin


Started this thread Reply With Quote
Thanked by:




Last Updated on October 8, 2022


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts