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,444 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
Platform: ninjatrader
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?
Daytrading to swingtrading
Traders Hideout
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Would a node-based workflow for automated trading be useful?
Traders Hideout
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
  #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
Platform: ninjatrader
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