NexusFi: Find Your Edge


Home Menu

 





HOW TO NT8, Visual Studio, Automated Deployment


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Jasonnator with 15 posts (38 thanks)
    2. looks_two sidlercom with 5 posts (0 thanks)
    3. looks_3 benJephunneh with 5 posts (0 thanks)
    4. looks_4 trendisyourfriend with 2 posts (1 thanks)
      Best Posters
    1. looks_one Jasonnator with 2.5 thanks per post
    2. looks_two addchild with 2 thanks per post
    3. looks_3 GraDman with 1 thanks per post
    4. looks_4 trendisyourfriend with 0.5 thanks per post
    1. trending_up 10,825 views
    2. thumb_up 43 thanks given
    3. group 21 followers
    1. forum 33 posts
    2. attach_file 5 attachments




 
Search this Thread

HOW TO NT8, Visual Studio, Automated Deployment

  #11 (permalink)
 
Jasonnator's Avatar
 Jasonnator 
Denver, Colorado United States
 
Experience: Intermediate
Platform: NT8 + Custom
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166


cutzpr View Post
Could you make some videos on how to find memory leaks inside Ninja script and profiling code.

It could be done but I don't think it would be a great bang for buck to the community. Fortunately for all of us NT8 users, the way the NinjaTrader API is designed, you never really get into situations where you have to worry about memory leaks. Subscribing to events and then forgetting to unsubscribe from them comes to mind. In NT8, you simply override the virtual methods (OnBarUpdate, OnMarketData, etc) instead of subscribing to the actual events. Therefore, all of the unsubscribing is taken care of for you in the base class which we can't touch, only utilize. In my opinion, NT8 did a fantastic job abstracting away stuff like that which beginner and intermediate developers could get themselves into trouble.

I say "never really" above but there are still absolutely ways that you could design a memory leak into an indicator or strategy. However, you'd be doing some fairly custom stuff most likely using the 3rd party dll approach. In that use case, you'd need to know more general .NET principles than just NT8's API.


Now the profiling code piece, whew, we could spend hours on that but I think it would be more effective than ambien for 99% of viewers and simply knock them out cold. If you're worried about some code being too heavy on your system resources, that would be a great thread to start and there are some mega good developers on here that could teach all of us something.

Jason

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
ZombieSqueeze
Platforms and Indicators
Cheap historycal L1 data for stocks
Stocks and ETFs
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Better Renko Gaps
The Elite Circle
 
  #12 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518

Hello @Jasonnator,

i'm failing with the first step to get the repository cloned. I've downloaded "GitHup Desktop" and entered the GitLab link seen in the video. But then the login page occurs. Should i have a GitLab account to clone your repository?

The video is way too fast or me and skip's some important steps, so i'm struggling here.



Regards,
Koepisch

Reply With Quote
  #13 (permalink)
 
Jasonnator's Avatar
 Jasonnator 
Denver, Colorado United States
 
Experience: Intermediate
Platform: NT8 + Custom
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166


@Koepisch, I initially included about 3x the content in that video but it was over 35 minutes so I decided to edit out a lot of which could be easily gotten from a more focused video. An intro to GIT was one of the items which was cut in order to focus more on how the solution works and keep it to the essentials for visual studio, ninjatrader, and indicators/strategies. The final edit of the video was intended for people to pause and rewatch certain topics. If you're ultimately stuck, post here so other can benefit as well if they are having similar problems.

I'd suggest starting with some simple GIT familiarization, this should get you started.

As far as the authentication error, you have to enter your GitLab credentials. It's free to sign up but you will need an account.

Started this thread Reply With Quote
  #14 (permalink)
 Koepisch 
@ Germany
 
Experience: Beginner
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: FDAX
Posts: 569 since Nov 2011
Thanks Given: 440
Thanks Received: 518

Thanks @Jasonnator, then i have to create the credentials first (i couldn't believe that "public" is behind a login fence). For me, the full video were the better starting point, because problems like this generate much bigger delays getting the things done. But i appreciate your efforts and think that i can make the transition to the "Visual Studio" dev. environment soon.

Reply With Quote
  #15 (permalink)
 
Jasonnator's Avatar
 Jasonnator 
Denver, Colorado United States
 
Experience: Intermediate
Platform: NT8 + Custom
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166

I'm pretty sure you could simply download the entire repo as a zip file but then you won't get any updates when the repo has changed pushed to it. You could do that directly from GitLab website (I think) without a login.

I do acknowledge that the initial learning curve can be a bit steep but my development went to the next level once I started using this pipeline. For me, it was totally worth the few things I had to learn (GIT, MSBuild, etc).

Started this thread Reply With Quote
  #16 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047

@Jasonnator

Followed.

Have you spent any time developing add-ons for NT yet? I have yet to attempt to use visual Studio with NT as I just hadn't really felt the need for it. But reading the docs, it seems like it may almost be necessary for developing add-ons.

Reply With Quote
  #17 (permalink)
 
Jasonnator's Avatar
 Jasonnator 
Denver, Colorado United States
 
Experience: Intermediate
Platform: NT8 + Custom
Broker: NT Brokerage, Kinetick, IQFeed, Interactive Brokers
Trading: ES
Posts: 159 since Dec 2014
Thanks Given: 40
Thanks Received: 166


forrestang View Post
@Jasonnator

Followed.

Have you spent any time developing add-ons for NT yet? I have yet to attempt to use visual Studio with NT as I just hadn't really felt the need for it. But reading the docs, it seems like it may almost be necessary for developing add-ons.

I have definitely used the AddOn feature but 99% of what I do is better accomplished with properly using the strategy + indicator combination. AddOn gives you a bit higher level control if you need it. I find that most of the time, I simply don't need the extra features it gives me since I don't heavily modify NT itself and usually just generate signals (indicator) then act accordingly on those signals (strategy).

I hope to have some new videos/tutorials out soon, stay tuned!

Started this thread Reply With Quote
  #18 (permalink)
 
forrestang's Avatar
 forrestang 
Chicago IL
 
Experience: None
Platform: Ninja, MT4, Matlab
Broker: CQG, AMP, MB, DTN
Trading: E/U, G/U
Posts: 1,329 since Jun 2010
Thanks Given: 354
Thanks Received: 1,047


Jasonnator View Post
I have definitely used the AddOn feature but 99% of what I do is better accomplished with properly using the strategy + indicator combination. AddOn gives you a bit higher level control if you need it. I find that most of the time, I simply don't need the extra features it gives me since I don't heavily modify NT itself and usually just generate signals (indicator) then act accordingly on those signals (strategy).

I hope to have some new videos/tutorials out soon, stay tuned!

Was just checking, as it seems there is not much out there outside of the docs with regards to add-on dev.

If curious, THIS is one of the things I'm looking to turn into an add-on. I think an add-on would lend itself nicely to this type of thing. Right now it's just what I have sitting on a chart.

It's a project I'll figure out eventually.

Reply With Quote
Thanked by:
  #19 (permalink)
benJephunneh
Huntsville, AL
 
Posts: 13 since Feb 2022
Thanks Given: 9
Thanks Received: 5

This post and your YouTube walkthrough have really lowered the viscosity of my brain juices, so you have my sincere thanks for showing how to develop without the default .csproj in VS.

And if there is a particular thread/forum section for discussing this kind of development, please point the way and I'll take this up where appropriate, but I'm hitting a roadblock when trying to call any built-in NT 8 method in any of my indicators or strategies, using this method of development (copying the NT8 system files, etc.). For example:

 
Code
#region Using directives
...
using NinjaTrader.NinjaScript.Indicators;
...
#endregion Using directives

public class TestIndicator : Indicator
{
#region Fields private LinRegSlope _lrs; #endregion Fields protected override void OnStateChange() {
... case State.DataLoaded:
_lrs = LinRegSlope(14); break;
...
}
}
I get an error stating that LinRegSlope is non-invocable. IntelliSense brings up the reference, but not as a method, apparently.

I can get around this by creating my own LinRegSlope with another name, causing me to have to also create a new SUM indicator, but this is going to get tedious if I have to do this with every built-in indicator I want to use.

Any ideas why the built-ins are not letting me invoke them?

I see, also, that the constructor methods are not at the bottom of the LinRegSlope code, when I look at the definition with F12. Looking at the definition of Indicator, though, I see the constructor methods. The methods are, of course, there in the NinjaScript file within the NinjaScript Editor.

So I also tried
 
Code
_lrs = NinjaTrader.NinjaScript.Indicators.LinRegSlope(14);
but this also doesn't work.

Attached Thumbnails
Click image for larger version

Name:	image_691.png
Views:	66
Size:	6.2 KB
ID:	321957  
Reply With Quote
  #20 (permalink)
benJephunneh
Huntsville, AL
 
Posts: 13 since Feb 2022
Thanks Given: 9
Thanks Received: 5


OK...I am able to call LinRegSlope when I have your solution loaded. Perhaps I'm missing a reference? The attached image shows what I have in my project.

Attached Thumbnails
Click image for larger version

Name:	image_282.png
Views:	66
Size:	10.2 KB
ID:	321958  
Reply With Quote




Last Updated on February 15, 2022


© 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