NexusFi: Find Your Edge


Home Menu

 





indicator update and template not saving


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one 35trader with 12 posts (1 thanks)
    2. looks_two Fat Tails with 10 posts (2 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 11,039 views
    2. thumb_up 3 thanks given
    3. group 2 followers
    1. forum 23 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
35trader
Toronto, Canada
 
Posts: 26 since Oct 2011
Thanks Given: 0
Thanks Received: 3

1. I want to update a EOD indicator right after the end of session vs on nextbar (session open) anyone have a script for this to happen or ideas?

2. Second issue, the following error: Indicator could not be serialized. (when saving as template)
The indicator recently had a live trend line added to it that updated per bar, since then the indicator cannot be saved as a template if the line is plotted on the chart, if its not plotted then I can save as a template.
Any ideas?

thanks


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Iran Airspace Contract Surges to 33.5% as Project Freedo …
Prediction Markets & Event Contracts
After $87M Settles NO: Irans Nuclear Redline Sets Up the …
Prediction Markets & Event Contracts
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Five Days Until the Gap Dies -- CME Goes 24/7 on All Dig …
Traders Hideout
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
22 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
5 thanks
  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114



35trader View Post
1. I want to update a EOD indicator right after the end of session vs on nextbar (session open) anyone have a script for this to happen or ideas?

2. Second issue, the following error: Indicator could not be serialized. (when saving as template)
The indicator recently had a live trend line added to it that updated per bar, since then the indicator cannot be saved as a template if the line is plotted on the chart, if its not plotted then I can save as a template.
Any ideas?

thanks

1. You need to set your indicator to CalculateOnBarClose = false, otherwise it will only update with the first tick of the new session.

2. First close the offending chart. Shutdown and restart NinjaTrader. Now add the indicator to a virgin chart (only this indicator and nothing else !) and try to save it as a template. If the problem persists, your indicator has coding errors.

3. In case that there are coding errors, please post the indicator here and I will have a look which lines of the code create the problem.


Reply With Quote
  #4 (permalink)
35trader
Toronto, Canada
 
Posts: 26 since Oct 2011
Thanks Given: 0
Thanks Received: 3


Fat Tails View Post
1. You need to set your indicator to CalculateOnBarClose = false, otherwise it will only update with the first tick of the new session.

2. First close the offending chart. Shutdown and restart NinjaTrader. Now add the indicator to a virgin chart (only this indicator and nothing else !) and try to save it as a template. If the problem persists, your indicator has coding errors.

3. In case that there are coding errors, please post the indicator here and I will have a look which lines of the code create the problem.

-----
1. I tried this and did not update when changed to false. Its currently programmed to update per bar, from what I can see I need it programmed to have Bars.Session.GetNextBeginEnd, but this is out of my league LOL, so will need to find a programmer to help me.

2. I fluked out and fixed this myself, a class needed switched from public to private.

Thanks for your response.


Reply With Quote
  #5 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114


35trader View Post
-----
1. I tried this and did not update when changed to false. Its currently programmed to update per bar, from what I can see I need it programmed to have Bars.Session.GetNextBeginEnd, but this is out of my league LOL, so will need to find a programmer to help me.

2. I fluked out and fixed this myself, a class needed switched from public to private.

Thanks for your response.

Don't hesitate to post the code if you need any help.


Reply With Quote
  #6 (permalink)
35trader
Toronto, Canada
 
Posts: 26 since Oct 2011
Thanks Given: 0
Thanks Received: 3


Fat Tails View Post
Don't hesitate to post the code if you need any help.

Fat Tails,

Here is basic EMA code, can you alter it to do the following:
1. Continue to update on each bar
2. Update at session end

many thanks

/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
Add(new Plot(Color.Orange, "EMA"));

Overlay = true;
}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
Value.Set(CurrentBar == 0 ? Input[0] : Input[0] * (2.0 / (1 + Period)) + (1 - (2.0 / (1 + Period))) * Value[1]);
}

#region Properties
/// <summary>
/// </summary>
[Description("Numbers of bars used for calculations")]
[GridCategory("Parameters")]
public int Period
{
get { return period; }
set { period = Math.Max(1, value); }
}
#endregion
}
}


Reply With Quote
  #7 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114

@35trader:

I do not understand your question.

The EMA updates after each bar and at session end, if you set it to CalculateOnBarClose = false.


Reply With Quote
  #8 (permalink)
35trader
Toronto, Canada
 
Posts: 26 since Oct 2011
Thanks Given: 0
Thanks Received: 3


Fat Tails View Post
@35trader:

I do not understand your question.

The EMA updates after each bar and at session end, if you set it to CalculateOnBarClose = false.


Where within the EMA script does it trigger the at session end update?

For some reason this false function does not have the same affect on my indicator as it does in the EMA script I pasted here as I see the EMA does update with false inserted as you stated.

thanks


Reply With Quote
  #9 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: Futures & Stocks
Posts: 9,887 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,114


35trader View Post
Where within the EMA script does it trigger the at session end update?

For some reason this false function does not have the same affect on my indicator as it does in the EMA script I pasted here as I see the EMA does update with false inserted as you stated.

thanks

You have never shown your indicator to anybody, how would I know what you have done?


Reply With Quote
  #10 (permalink)
35trader
Toronto, Canada
 
Posts: 26 since Oct 2011
Thanks Given: 0
Thanks Received: 3



Fat Tails View Post
You have never shown your indicator to anybody, how would I know what you have done?



Can you do the following.
Where within the EMA script does it trigger the at session end update and explain it?

thanks


Reply With Quote




Last Updated on August 31, 2012


© 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