NexusFi: Find Your Edge


Home Menu

 





NinjaTrader Mystery - Indicator Changes !


Discussion in Platforms and Indicators

Updated
      Top Posters
    1. looks_one Fat Tails with 3 posts (1 thanks)
    2. looks_two Quick Summary with 1 posts (0 thanks)
    3. looks_3 AlexanderBecker with 1 posts (0 thanks)
    4. looks_4 sam028 with 1 posts (0 thanks)
    1. trending_up 3,332 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 2 attachments




 
Search this Thread
  #1 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary 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,117

I have a problem with the way the plots are initialized. Here comes a small indicator. Please apply it to a default ES chart and then just follow the instructions.

Any idea, what is wrong?


Attached Files
Elite Membership required to download: Test.zip
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
No book, only a stair: journaling fills where price move …
Cryptocurrency
Daytrading to swingtrading
Traders Hideout
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Ninjatrader users - good CONNECTIONs post and article fr …
NinjaTrader
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Administrator
 
Posts: 3,766 since Jun 2009
Thanks Given: 3,836
Thanks Received: 4,690


The indicator seems to do what you're asking it to do.
What was your expected result ?


Success requires no deodorant! (Sun Tzu)
Reply With Quote
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary 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,117


sam028 View Post
The indicator seems to do what you're asking it to do.
What was your expected result ?


My original problem can be better understood with this indicator.

The plot is not re-initializing, when toggling from one instrument to another. I expected that the plot would reinitialize, because it is in the Initialize() section! But toggling does not initialize the plot, because you want to keep the colours and pen properties, so I was trapped.

Apply to any instrument, then toggle between instruments. Plot.Name of first instrument remains active, until you hit FDAX. Then Plot.Name will remain FDAX.


Attached Files
Elite Membership required to download: Test.zip
Started this thread Reply With Quote
Thanked by:
  #5 (permalink)
 
AlexanderBecker's Avatar
 AlexanderBecker 
Germany, Karlsruhe
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP
Trading: Futures, EUR.USD
Posts: 1 since Mar 2010
Thanks Given: 1
Thanks Received: 0

Hi.

I have looked at the *zip and the Test.cs of your last post.

If you change your overload of OnStartup like this then the Indicator-Plots' name will be setup with the new instruments' name:

protectedoverridevoid OnStartUp()
{
Plots[0].Name = Instrument.MasterInstrument.Name ==
"FDAX"
? "Hello, I am FDAX"
: string.Format("Hello, I am [{0}]", Instrument.MasterInstrument.Name);
}



Reply With Quote
  #6 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Legendary 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,117


AlexanderBecker View Post
Hi.

I have looked at the *zip and the Test.cs of your last post.

If you change your overload of OnStartup like this then the Indicator-Plots' name will be setup with the new instruments' name:

protectedoverridevoid OnStartUp()
{
Plots[0].Name = Instrument.MasterInstrument.Name ==
"FDAX"
? "Hello, I am FDAX"
: string.Format("Hello, I am [{0}]", Instrument.MasterInstrument.Name);

}



That is correct. The main idea of this thread was to show that an indicator is not reinitialized, if you toggle from one instrument to another, where as OnStartUp() is executed when toggling. Reinitializing is not possible, because you want to keep some of the properties defined, such as the colors of the plot.

So if you initialize the plots by using the name of an instrument, it will stay with the first instrument for ever. Conclusion: You should not use any reference to Instrument.MasterInstrument.Name in the Intialize() section, but do that in OnStartUp().

Your suggestion compensates the error in the Initialize() section, but to code this in a clean way, the error should not be made in the first place!


Started this thread Reply With Quote




Last Updated on October 22, 2010


© 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