NexusFi: Find Your Edge


Home Menu

 





Using internal indicators within a custom indicator


Discussion in NinjaTrader

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




 
Search this Thread

Using internal indicators within a custom indicator

  #1 (permalink)
 jalley 
La Grange, CA USA
 
Experience: Intermediate
Platform: Ninjatrader, MetaTrader
Broker: NinjaTrader Brokerage
Trading: MES, MNQ, M2K, MYM
Posts: 25 since Jun 2020
Thanks Given: 14
Thanks Received: 7

I am having an issue creating a new custom indicator based upon the Wiseman stock indicators from NinjaTrader 8.

I can create a strategy using the Wiseman Alligator and unlock the code and compile with it working.

If I transfer this code over to a new custom indicator and add this line which works fine in the Strategy version, it errors with: 'WisemanAlligator' cannot be used like a method.

The line that works with the strategy but not in the indicator:
WisemanAlligator1 = WisemanAlligator(Close, 13, 8, 5, 8, 5, 3);

NinjaTrader's Help Page... (doesn't work for me):
https://ninjatrader.com/support/helpGuides/nt8/?indicators.htm (Goto Wiseman Alligator)

The example: (doesn't work for me):
// Prints the current value of the teeth for the Wiseman Alligator
double value = WisemanAlligator(13, 8, 5, 8, 5, 3).Teeth[0];
Print("The current Wiseman Alligator teeth value is " + value.ToString());

Any Ideas?

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
How to apply profiles
Traders Hideout
PowerLanguage & EasyLanguage. How to get the platfor …
EasyLanguage Programming
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Tao te Trade: way of the WLD
24 thanks
Just another trading journal: PA, Wyckoff & Trends
23 thanks
Bigger Wins or Fewer Losses?
21 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
JonnyBoy's Avatar
 JonnyBoy 
Montreal, Quebec
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: Kinetick
Trading: ES
Posts: 1,561 since Apr 2012
Thanks Given: 706
Thanks Received: 3,858


jalley View Post
I am having an issue creating a new custom indicator based upon the Wiseman stock indicators from NinjaTrader 8.

I can create a strategy using the Wiseman Alligator and unlock the code and compile with it working.

If I transfer this code over to a new custom indicator and add this line which works fine in the Strategy version, it errors with: 'WisemanAlligator' cannot be used like a method.

The line that works with the strategy but not in the indicator:
WisemanAlligator1 = WisemanAlligator(Close, 13, 8, 5, 8, 5, 3);

NinjaTrader's Help Page... (doesn't work for me):
https://ninjatrader.com/support/helpGuides/nt8/?indicators.htm (Goto Wiseman Alligator)

The example: (doesn't work for me):
// Prints the current value of the teeth for the Wiseman Alligator
double value = WisemanAlligator(13, 8, 5, 8, 5, 3).Teeth[0];
Print("The current Wiseman Alligator teeth value is " + value.ToString());

Any Ideas?

Mmmm. Just a very quick thought (and I have not looked into this at all) - but NinjaTrader have obfuscated the Wiseman suite of indicators. This could be the problem, but as I said this is just a quick guess.

--------------------------------------------------------
- Trade what you see. Invest in what you believe -
--------------------------------------------------------
Reply With Quote
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629



JonnyBoy View Post
Mmmm. Just a very quick thought (and I have not looked into this at all) - but NinjaTrader have obfuscated the Wiseman suite of indicators. This could be the problem, but as I said this is just a quick guess.

Obfuscation is not related: it's not because an indicator file is obfuscated that it can't export its dataseries value.

@jalley: I did a quick test and I don't see any problem using this code:
 
Code
                            
public class FooBar Indicator {

        
WisemanAlligator myIndy;        
        protected 
override void OnStateChange() {
            if (
State == State.SetDefaults) {
                
Description                                    = @"";
                
Name                                        "FooBar";
                
Calculate                                    Calculate.OnBarClose;
                
IsOverlay                                    false;
                
DisplayInDataBox                            true;
                
DrawOnPricePanel                            true;
                
DrawHorizontalGridLines                        true;
                
DrawVerticalGridLines                        true;
                
PaintPriceMarkers                            true;
                
ScaleJustification                            NinjaTrader.Gui.Chart.ScaleJustification.Right;            
                
IsSuspendedWhileInactive                    true;
            }
            else if (
State == State.Configure) {
                
myIndy WisemanAlligator(1385853);
            }
        }

        protected 
override void OnBarUpdate() {
            Print(
myIndy.Teeth[0]);
        }
    } 

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 jalley 
La Grange, CA USA
 
Experience: Intermediate
Platform: Ninjatrader, MetaTrader
Broker: NinjaTrader Brokerage
Trading: MES, MNQ, M2K, MYM
Posts: 25 since Jun 2020
Thanks Given: 14
Thanks Received: 7

I found that the issue is that it will compile fine in NinjaEditor but not in Visual Studio after playing more with it. Wonder what's missing in Visual Studio to cause this.

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


jalley View Post
I found that the issue is that it will compile fine in NinjaEditor but not in Visual Studio after playing more with it. Wonder what's missing in Visual Studio to cause this.

You can debug NinjaScript with Visual Studio but you can't compile with it.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:




Last Updated on August 14, 2020


© 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