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 2,537 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 2 attachments




 
Search this Thread

NinjaTrader Mystery - Indicator Changes !

  #1 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102

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?
Exit Strategy
NinjaTrader
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
Are there any eval firms that allow you to sink to your …
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
59 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
23 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
  #4 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102


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


© 2024 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 - Privacy Policy - Downloads - Top
no new posts