NexusFi: Find Your Edge


Home Menu

 





Strategy Wizard Coding Question


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Big Mike with 3 posts (0 thanks)
    2. looks_two njaisson with 3 posts (0 thanks)
    3. looks_3 max-td with 1 posts (0 thanks)
    4. looks_4 TraderG with 1 posts (0 thanks)
    1. trending_up 3,942 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 8 posts
    2. attach_file 1 attachments




 
Search this Thread

Strategy Wizard Coding Question

  #1 (permalink)
 njaisson 
Madrid
 
Experience: Intermediate
Platform: Ninja
Posts: 15 since Sep 2009
Thanks Given: 0
Thanks Received: 0

Hello!

Using the NT wizard is there a way to flat all the positions taken before I open the strat whenever the time of the opening, so that it does not continue to trade positions taken before I open the strategy?

Many Thanks,

Nicolas

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NexusFi Journal Challenge - April 2024
Feedback and Announcements
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
Futures True Range Report
The Elite Circle
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
43 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541


njaisson View Post
Hello!

Using the NT wizard is there a way to flat all the positions taken before I open the strat whenever the time of the opening, so that it does not continue to trade positions taken before I open the strategy?

Many Thanks,

Nicolas

Not 100% sure this is what you are looking for, but in Control Center, Tools - Options, there is a section for Strategies - NinjaScript:

[img]https://nexusfi.com/v/czf3ga.png[/img]

Set it to "Wait until Flat" to make sure that once you add a strategy to a chart, the strategy will not open a new position until it is flat. In other words, if the strategy "should have been" long 5 bars before you added it to the chart, this will prevent it from thinking it is long and thus royally screwing up your account and getting out of sync.

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 Reply With Quote
  #3 (permalink)
 
max-td's Avatar
 max-td 
Frankfurt
 
Experience: Intermediate
Platform: NinjaTrader
Trading: FGBL 6E B4
Posts: 1,752 since Jun 2009
Thanks Given: 2,309
Thanks Received: 927


But Mike, what you show here is NT7 !
that option is not available in NT 6.5.

maybe, nicolas, try to explain a bit better what you are looking for.

max-td
Reply With Quote
  #4 (permalink)
 njaisson 
Madrid
 
Experience: Intermediate
Platform: Ninja
Posts: 15 since Sep 2009
Thanks Given: 0
Thanks Received: 0

Cool man! Thanks for this. I was wondering as well what is the function in the wizard to close the strategy when a certain PnL has been reached. I am asking because I noticed that even if you code that it should exit long or short positions when PnL is inferior or superior to a certain value, it continues to place trades and immediately close them afertwards. This will be my last enquiry, promised!

Started this thread Reply With Quote
  #5 (permalink)
 njaisson 
Madrid
 
Experience: Intermediate
Platform: Ninja
Posts: 15 since Sep 2009
Thanks Given: 0
Thanks Received: 0

Nice results on CL yesterday in automated trading :-))

Attached Thumbnails
Click image for larger version

Name:	CL.jpg
Views:	269
Size:	168.1 KB
ID:	11391  
Started this thread Reply With Quote
  #6 (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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541


max-td View Post
But Mike, what you show here is NT7 !
that option is not available in NT 6.5.

maybe, nicolas, try to explain a bit better what you are looking for.

The part I highlighted is in 6.5 and is what I was talking about.

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 Reply With Quote
  #7 (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,399 since Jun 2009
Thanks Given: 33,175
Thanks Received: 101,541


njaisson View Post
Cool man! Thanks for this. I was wondering as well what is the function in the wizard to close the strategy when a certain PnL has been reached. I am asking because I noticed that even if you code that it should exit long or short positions when PnL is inferior or superior to a certain value, it continues to place trades and immediately close them afertwards. This will be my last enquiry, promised!

I've never used the wizard, but to my knowledge you can't do that in the wizard. There are plenty of examples of code on how to do this on the forum, you'll need to learn to code C# directly and forget the wizard.

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 Reply With Quote
  #8 (permalink)
 TraderG 
Toronto
 
Experience: Intermediate
Platform: NinjaTrader, TOS
Broker: Rithmic
Trading: CL
Posts: 17 since Aug 2009
Thanks Given: 1
Thanks Received: 9

I am trying to backtest the StochVolTrigger using Strategy wizard to create a simple buy/sell orders. Can someone tell me how I can use the NT wizard to automate a buy or sell when this indicator paints a green or red dot on the chart.

Reply With Quote
  #9 (permalink)
 
revtrader's Avatar
 revtrader 
Harrisburg PA
 
Experience: Advanced
Platform: NT
Frequency: Daily
Duration: Minutes
Posts: 63 since Jul 2009
Thanks Given: 180
Thanks Received: 44

Here is what I use in my strategies

protected override void OnBarUpdate()
{
if (Historical)
return;

I enter this first right under OnBarUpdate. in my code. This will not take any historical trades when applying the strategy to the chart.

Hope this helps

Reply With Quote
Thanked by:




Last Updated on October 6, 2010


© 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