Go Back   NinjaTrader Support Forum > NinjaTrader 8 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

NinjaTrader
Reply
 
Thread Tools Display Modes
Old 03-12-2018, 04:05 PM   #1
mntemel
Junior Member
 
Join Date: Oct 2011
Posts: 23
Thanks: 5
Thanked 3 times in 1 post
Default 3rd Party Indicator integration

Hi,

I'm not sure if you can help since my query involves a 3rd party indicator but I thought you might be able to give some direction.

When using strategy builder, I've added a simple condition with a 3rd party indicator just to test. When I do "View Code", I see that the indicator is integrated as


Code:
public class SBtest01 : Strategy
{
private NinjaTrader.NinjaScript.Indicators.Sim22.Sim22_DeltaV3 Sim22_DeltaV31;

protected override void OnStateChange()
{...}
Code:
else if (State == State.DataLoaded)
{				
Sim22_DeltaV31= Sim22_DeltaV3(Close, DeltaV3BarWidthTypeEnum.Auto, NinjaTrader.NinjaScript.AddOns.Sim22_DeltaUtilities+DeltaCalculationTypeEnum.BidAsk, NinjaTrader.NinjaScript.AddOns.Sim22_DeltaUtilities+DeltaCotType.None, true, false, false, GaplessEmaTypeEnum.Normal, 20, NinjaTrader.NinjaScript.AddOns.Sim22_DeltaUtilities+DeltaTradeSizeFilterTypeEnum.None, 1, NinjaTrader.NinjaScript.AddOns.Sim22_HaUtilities+HeikenAshiCalculationType.None, false, true, true);
}
and the condition I set is;

Code:
if (Sim22_DeltaV31.DeltaClose[0] < Sim22_DeltaV31.DeltaClose[1])
{
EnterShort(Convert.ToInt32(DefaultQuantity), "");
}
When I compile, I get 8 lines of error messages for the State.DataLoaded section

These are the error messages;

Quote:
Error
'NinjaTrader.NinjaScript.AddOns.Sim22_DeltaUtiliti es' is a 'type', which is not valid in the given context
The name 'DeltaCalculationTypeEnum' does not exist in the current context
'NinjaTrader.NinjaScript.AddOns.Sim22_DeltaUtiliti es' is a 'type', which is not valid in the given context
The name 'DeltaCotType' does not exist in the current context
'NinjaTrader.NinjaScript.AddOns.Sim22_DeltaUtiliti es' is a 'type', which is not valid in the given context
The name 'DeltaTradeSizeFilterTypeEnum' does not exist in the current context
'NinjaTrader.NinjaScript.AddOns.Sim22_HaUtilities' is a 'type', which is not valid in the given context
The name 'HeikenAshiCalculationType' does not exist in the current context
I have noticed that there are plus signs (+) in the code where the error messages are referring to, which seemed unusual. I replaced them dots, it compiled but strategy did not enter any orders.

I would really appreciate if you could give some guidance to fix this.

Thanks
MT
mntemel is offline  
Reply With Quote
Old 03-13-2018, 07:21 AM   #2
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello mntemel,

Thank you for your post.

Can you view the code for the Sim22_DeltaV31 when you are in the NinjaScript Editor? Or is this file protected in an assembly?

I look forward to your response.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 03-13-2018, 07:36 AM   #3
mntemel
Junior Member
 
Join Date: Oct 2011
Posts: 23
Thanks: 5
Thanked 3 times in 1 post
Default

Hi Patrick,

I can see the code, it's not protected.

Thanks
MT
mntemel is offline  
Reply With Quote
Old 03-13-2018, 12:02 PM   #4
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello mntemel,

Thank you for your response.

The periods or dots are the correct means to use these and not the '+' symbol. If the strategy is not taking orders then it would be recommended to place Print() function calls where your conditions return true to determine if the conditions are the reason the orders did not submit.

Please let me know if you have any questions.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 03-13-2018, 12:07 PM   #5
mntemel
Junior Member
 
Join Date: Oct 2011
Posts: 23
Thanks: 5
Thanked 3 times in 1 post
Default

Hi Patrick,

Thank your for your reply. I'll use the print method to understand what's going on with the condition.

On the other hand what I don't understand is; why strategy builder is adding the indicator into the strategy with these "+" symbols which is causing a compile error, any thoughts?

Thanks
MT
mntemel is offline  
Reply With Quote
Old 03-13-2018, 01:15 PM   #6
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello mntemel,

Thank you for your response.

Is this an indicator you can send to me for testing?

You can send the indicator to platformsupport[at]ninjatrader[dot]com with 'ATTN: Patrick H' in the subject line and a reference to this thread in the body of the email.

You can export your indicator by going to Tools > Export > NinjaScript Add On > Add > select your indicator > OK > Export > name the file 'NTsupport' > Save.
The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 03-19-2018, 10:51 AM   #7
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO
Posts: 11,646
Thanks: 783
Thanked 2,012 times in 1,938 posts
Default

Hello MT,

Thank you for your patience.

A fix for this issue is expected in the next release of NinjaTrader 8. I cannot guarantee implementation at this time and I do not have a release date.

Please let me know if you have any questions.
NinjaTrader_PatrickH is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
3rd party indicator will not save imalil Indicator Development 5 01-12-2017 08:06 AM
3rd Party Indicator compile error bbucha_stk Strategy Development 4 12-11-2010 12:23 PM
cant load 3rd party indicator lindsayf Platform Technical Support 4 09-06-2010 07:18 AM
3rd party indicator support in NinjaScript Brian234 Platform Technical Support 5 11-04-2009 10:07 AM
Using 3rd party indicators in another indicator eDanny General Development 8 12-04-2008 03:57 PM


All times are GMT -6. The time now is 04:38 PM.

Futures, foreign currency and options trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.

CFTC Rules 4.41 - Hypothetical or Simulated performance results have certain limitations, unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, such as lack of liquidity. Simulated trading programs in general are also subject to the fact that they are designed with the benefit of hindsight. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

This website is hosted and operated by NinjaTrader, LLC (“NT”), a software development company which owns and supports all proprietary technology relating to and including the NinjaTrader trading platform. NT is an affiliated company to NinjaTrader Brokerage (“NTB”), which is a NFA registered introducing broker (NFA #0339976) providing brokerage services to traders of futures and foreign exchange products. This website is intended for educational and informational purposes only and should not be viewed as a solicitation or recommendation of any product, service or trading strategy. No offer or solicitation to buy or sell securities, securities derivative or futures products of any kind, or any type of trading or investment advice, recommendation or strategy, is made, given, or in any manner endorsed by any NT affiliate and the information made available on this Web site is not an offer or solicitation of any kind. Specific questions related to a brokerage account should be sent to your broker directly. The content and opinions expressed on this website are those of the authors and do not necessarily reflect the official policy or position of NT or any of its affiliates. 

Vendors along with their websites, products and services, collectively referred to as (“Vendor Content”), are independent persons or companies that are in no manner affiliated with NT or any if its affiliates. NT or any of its affiliates are not responsible for, do not approve, recommend or endorse any Vendor Content referenced on this website and it’s your sole responsibility to evaluate Vendor Content. Please be aware that any performance information provided by a vendor should be considered hypothetical and must contain the disclosures required by NFA Rule 2-29(c). If you are interested in learning more about, or investigating the quality of, any such Vendor Content you must contact the vendor, provider or seller of such Vendor Content. No person employed by, or associated with, NT or any of its affiliates is authorized to provide any information about any such Vendor Content.