NexusFi: Find Your Edge


Home Menu

 





VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one calhawk01 with 10 posts (1 thanks)
    2. looks_two Big Mike with 9 posts (193 thanks)
    3. looks_3 stephenszpak with 6 posts (0 thanks)
    4. looks_4 spinnybobo with 6 posts (2 thanks)
      Best Posters
    1. looks_one Big Mike with 21.4 thanks per post
    2. looks_two piersh with 8 thanks per post
    3. looks_3 zeller4 with 7 thanks per post
    4. looks_4 Cloudy with 1.5 thanks per post
    1. trending_up 85,359 views
    2. thumb_up 231 thanks given
    3. group 61 followers
    1. forum 67 posts
    2. attach_file 3 attachments




 
Search this Thread

VIDEO TUTORIAL: How to create an advanced NinjaTrader Strategy

  #31 (permalink)
 Buddy 
BC Canada
 
Experience: Beginner
Platform: Several
Trading: Stocks, Currency
Posts: 25 since Apr 2011
Thanks Given: 29
Thanks Received: 4

Hi; Mike
Very nice and very help full Great job. The video was clear, valuable and easy to understand.
Best Regards

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Request for MACD with option to use different MAs for fa …
NinjaTrader
ZombieSqueeze
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Retail Trading As An Industry
58 thanks
Battlestations: Show us your trading desks!
48 thanks
NexusFi site changelog and issues/problem reporting
47 thanks
GFIs1 1 DAX trade per day journal
32 thanks
What percentage per day is possible? [Poll]
31 thanks

  #32 (permalink)
 timothy 
minneapolis
 
Experience: Beginner
Platform: ninjatrader
Trading: nq
Posts: 6 since Aug 2010
Thanks Given: 1
Thanks Received: 0

Thanks Mike for the video . Very helpful for a new guy.

Reply With Quote
  #33 (permalink)
spr1ngfl1ng
Boston Massachusetts
 
Posts: 1 since May 2011
Thanks Given: 9
Thanks Received: 0


(My first post as a new member -- hi everyone! Mike, this site is amazing, so much quality content...)

This video was very helpful for me, simply by going through the entire process from start to finish in a straightforward fashion. I appreciate that you took the time to capture a legible HD video. +1 for high-speed typing and compile-from-the-hip.

Now armed with some programming experience, and this video, I'm off to write my first ninjascript strategy.

(again: This site! Think of the dollars and years you've saved everyone by bringing this together in one spot...)

Thanks!

Reply With Quote
  #34 (permalink)
WBJo
Newark
 
Posts: 2 since Jul 2011
Thanks Given: 0
Thanks Received: 1

Hey - I am a newbie to Ninja trader platform. I have entered EXACTLY what Big Mike showed in the video but when I compile, I get this error no matter what I do:


Strategy\NewTest.cs The name 'be3' does not exist in the current context CS0103 - click for info 115 26
Strategy\NewTest.cs The name 'be3' does not exist in the current context CS0103 - click for info 116 19

Line 115 and 116 don't contain 'be3'. Is there some simple newbie thing I am missing?! Even if I completely remove be3 from the script and replace it with something else, I still get the same error. So I am mightily confused. Any help would be much appreciated .... Thanks!

WBJo

Reply With Quote
  #35 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,322 since Jun 2009
Thanks Given: 33,143
Thanks Received: 101,476


WBJo View Post
Hey - I am a newbie to Ninja trader platform. I have entered EXACTLY what Big Mike showed in the video but when I compile, I get this error no matter what I do:


Strategy\NewTest.cs The name 'be3' does not exist in the current context CS0103 - click for info 115 26
Strategy\NewTest.cs The name 'be3' does not exist in the current context CS0103 - click for info 116 19

Line 115 and 116 don't contain 'be3'. Is there some simple newbie thing I am missing?! Even if I completely remove be3 from the script and replace it with something else, I still get the same error. So I am mightily confused. Any help would be much appreciated .... Thanks!

WBJo

You have a type-o. Case sensitivity matters.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #36 (permalink)
WBJo
Newark
 
Posts: 2 since Jul 2011
Thanks Given: 0
Thanks Received: 1

Thanks Mikewbjoh998 - I figured that part out, and checked everything. Still possible, of course (been down that road many times win other programming environments) but I'm guessing not. When I load a standard indicator like Bollinger and try to compile I get a similar error message, which leads me to believe something is wrong in general with my installation.

Reply With Quote
The following user says Thank You to WBJo for this post:
  #37 (permalink)
 RockyLee 
Quebec
 
Experience: Intermediate
Platform: MultiCharts
Trading: Futures
Posts: 3 since Nov 2012
Thanks Given: 0
Thanks Received: 1

Hi Mike, Thank you for this video, it was really helpful.

I am wondering how I could program my own set of rule to "optimize on" like you did with " _mike_preferred" I don't have problem to program in C# and I already did some strategies who look profitable when I test them in the market replay.

But I would really like to be able to set my own set of rule for optimization.
Please help me with that.

Thank you

Reply With Quote
  #38 (permalink)
 calhawk01 
baltimore marylnd
 
Experience: Beginner
Platform: ninja
Trading: es
Posts: 91 since May 2013
Thanks Given: 5
Thanks Received: 11

hi i'm not a programmer but am learning from this script. this script seems to buy 3 contracts. how can I only make it one contract?
 
Code
		private void GoLong()
		{
			SetStopLoss("target1", CalculationMode.Price, Close[0] - (Stop*TickSize), false);
			
			SetProfitTarget("target1", CalculationMode.Price, Close[0] + (Target1*TickSize));
			SetProfitTarget("target2", CalculationMode.Price, Close[0] + ((Target1+Target2)*TickSize));
			SetProfitTarget("target3", CalculationMode.Price, Close[0] + ((Target1+Target2+Target3)*TickSize));
			
			EnterLong("target1");

						
		}
will that do?

what I'm trying to do is, buy 1 contract when my signal occurs, and move my targets and stops as they occur only for ONE contract

Reply With Quote
  #39 (permalink)
 
NJAMC's Avatar
 NJAMC 
Atkinson, NH USA
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader 8/TensorFlow
Broker: NinjaTrader Brokerage
Trading: Futures, CL, ES, ZB
Posts: 1,970 since Dec 2010
Thanks Given: 3,037
Thanks Received: 2,394


calhawk01 View Post
hi i'm not a programmer but am learning from this script. this script seems to buy 3 contracts. how can I only make it one contract?
 
Code
		private void GoLong()
		{
			SetStopLoss("target1", CalculationMode.Price, Close[0] - (Stop*TickSize), false);
			
			SetProfitTarget("target1", CalculationMode.Price, Close[0] + (Target1*TickSize));
			SetProfitTarget("target2", CalculationMode.Price, Close[0] + ((Target1+Target2)*TickSize));
			SetProfitTarget("target3", CalculationMode.Price, Close[0] + ((Target1+Target2+Target3)*TickSize));
			
			EnterLong("target1");

						
		}
will that do?

what I'm trying to do is, buy 1 contract when my signal occurs, and move my targets and stops as they occur only for ONE contract

You should be able to delete the following line because you don't enter a position with a similar name:
SetProfitTarget("target2", CalculationMode.Price, Close[0] + ((Target1+Target2)*TickSize));
SetProfitTarget("target3", CalculationMode.Price, Close[0] + ((Target1+Target2+Target3)*TickSize));

Nil per os
-NJAMC [Generic Programmer]

LOM WIKI: NT-Local-Order-Manager-LOM-Guide
Artificial Bee Colony Optimization
Visit my NexusFi Trade Journal Reply With Quote
  #40 (permalink)
 calhawk01 
baltimore marylnd
 
Experience: Beginner
Platform: ninja
Trading: es
Posts: 91 since May 2013
Thanks Given: 5
Thanks Received: 11


Thank you for the reply.

Now I have:

 
Code
		private void GoLong()
		{
			SetStopLoss("target1", CalculationMode.Price, Close[0] - (Stop*TickSize), false);
			
			SetProfitTarget("target1", CalculationMode.Price, Close[0] + (Target1*TickSize));
			
			EnterLong("target1");

		}


		
		private void ManageOrders()
		{

			if (Position.MarketPosition == MarketPosition.Long)
			{
				if (BE2 && High[0] > Position.AvgPrice + (Target1*TickSize))
					SetStopLoss("target2", CalculationMode.Price, Position.AvgPrice, false);
				
				if (BE3 && High[0] > Position.AvgPrice + ((Target1+Target2)*TickSize))
					SetStopLoss("target3", CalculationMode.Price, Position.AvgPrice, false);
			
			}
This still does not seem to work. It exits at profit target1

Reply With Quote





Last Updated on October 23, 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