Using internal indicators within a custom indicator - futures io
futures io



Using internal indicators within a custom indicator


Discussion in NinjaTrader

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




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

Using internal indicators within a custom indicator

(login for full post details)
  #1 (permalink)
 jalley 
La Grange, CA USA
 
Experience: Intermediate
Platform: Ninjatrader, MetaTrader
Broker: NinjaTrader Brokerage
Trading: MES, MNQ, M2K, MYM
 
Posts: 23 since Jun 2020
Thanks: 14 given, 6 received

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 futures io Trade Journal Started this thread Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(111 thanks from 18 posts)
looks_twoSalao's Journalby Salao
(36 thanks from 8 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(29 thanks from 13 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(14 thanks from 9 posts)
looks_5Maybe a little bit different journalby Malykubo
(9 thanks from 9 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Would You Sell Your System?
73 thanks
Big Mike in Ecuador
56 thanks
The Crude Dude Oil Trading System
50 thanks
The New Micro Contract - MICRO BITCOIN coming May 2021
25 thanks
futures io site changelog and issues/problem reporting
24 thanks
 
(login for full post details)
  #2 (permalink)
 JonnyBoy 
Market Wizard
Montreal, Quebec
 
Experience: Advanced
Platform: NinjaTrader 8
Broker: Kinetick
Trading: ES
 
JonnyBoy's Avatar
 
Posts: 1,559 since Apr 2012
Thanks: 706 given, 3,737 received


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
 
(login for full post details)
  #3 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,675 since Jun 2009
Thanks: 3,790 given, 4,507 received



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
The following 2 users say Thank You to sam028 for this post:
 
(login for full post details)
  #4 (permalink)
 jalley 
La Grange, CA USA
 
Experience: Intermediate
Platform: Ninjatrader, MetaTrader
Broker: NinjaTrader Brokerage
Trading: MES, MNQ, M2K, MYM
 
Posts: 23 since Jun 2020
Thanks: 14 given, 6 received

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 futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
 sam028 
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,675 since Jun 2009
Thanks: 3,790 given, 4,507 received


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
The following user says Thank You to sam028 for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > Using internal indicators within a custom indicator


Last Updated on August 14, 2020


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1,800 in prizes!

April

Seven Trading Mistakes Solved With Smart Trading Tools w/Brannigan Barrett

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts