Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Ninjascript is a customized version of the Microsoft® C# object oriented programming language.
With a good foundation in the C# language, learning Ninjascript is relatively easy.
This looks like a particularly good introductory course.
Understandable, but not watered down.
"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.” Prof. Albert Bartlett
Thank you for posting this C# course! I already started doing code academy C# course and would like to deepen my knowledge.
I'd be curious if you know any YouTubers that do a lot of coding examples/stuff on NinjaScript. I've found a couple of ones, but you might have some names in your mind.
Next, Google. If you have a question about a command just type:
ninjatrader 'your question'
ex.: ninjatrader exitlong
Next, ChatGPT:
ex.:
in C#, how would you remove the first char of a string but keep the remaining ?
In C#, you can remove the first character of a string and keep the remaining characters by using the Substring method. Here's an example:
Another example: Me:
Create a strategy in C Sharp for Ninjatrader to go long only when price crosses a moving average. Just write the relevant code that goes into the method OnBarUpdate()
ChatGPT
Sure, here's an example strategy in C# for NinjaTrader that goes long (buys) when the price crosses above a simple moving average (SMA). This code should be placed within the OnBarUpdate() method of your strategy class:
You can refine your request if you see something wrong:
Ex.
About the threshold variable, my chart symbol is the NQ futures contract, the minimum movement is 1 tick so modify this variable to use tick offset instead.
In this modified version, the tickOffset variable determines how many ticks above the moving average the current price needs to be in order to trigger a long entry. The TickSize property gives you the tick size of the instrument you're trading. The threshold is calculated as the moving average plus the tick offset multiplied by the tick size.
Make sure to adjust the tickOffset value according to your trading preferences and strategies.
---
Use the Strategy Builder and unlock the code and study it.
You are not breaking any rule unless you are selling your own stuff. If you are recommending someone else's material that you've found to be good, then you are just doing the right thing by letting others know about it.
Bob.
When one door closes, another opens.
-- Cervantes, Don Quixote