NexusFi: Find Your Edge


Home Menu

 





Edit Strategy to Start in Disabled State


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one ratfink with 5 posts (3 thanks)
    2. looks_two danyzuko with 4 posts (3 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 trendwaves with 1 posts (2 thanks)
    1. trending_up 2,839 views
    2. thumb_up 8 thanks given
    3. group 2 followers
    1. forum 10 posts
    2. attach_file 0 attachments




 
Search this Thread

Edit Strategy to Start in Disabled State

  #1 (permalink)
danyzuko
San Antonio TX/USA
 
Posts: 15 since Jan 2015
Thanks Given: 12
Thanks Received: 3

Hey everyone, I'm waiting forever for a strategy I bought to be changed to start with both long and short trading switches in the off state instead of them both being on upon enabling the strategy.

Can anyone tell me how to get into the strategy file (I'm guessing the .cs file maybe...), and make the adjustment and save as a new file with the settings changed? Bottom line: I would like to do this as non-invasive and keep the original as backup.

Thanks in advance...

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Better Renko Gaps
The Elite Circle
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
34 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
Vinny E-Mini & Algobox Review TRADE ROOM
13 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #3 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425



danyzuko View Post
Hey everyone, I'm waiting forever for a strategy I bought to be changed to start with both long and short trading switches in the off state instead of them both being on upon enabling the strategy.

Can anyone tell me how to get into the strategy file (I'm guessing the .cs file maybe...), and make the adjustment and save as a new file with the settings changed? Bottom line: I would like to do this as non-invasive and keep the original as backup.

Thanks in advance...

First I'm assuming you have source code access included and already have a zip file that was sent to import into NT7 as backup anyway.

I'm also assuming from what you say that the startup condition variable(s) have not been made available in the Strategy Parameters section. You could make them be if so desired.

To start with just use the NT 'Tools->Edit NinjaScript->Strategy' right-mouse menu, find your strategy in the list and open it.

Then do right-mouse-menu -> 'Save As...' and save it under a new name. Your original Strategy will be left untouched.

Find (I'm guessing) the one or two control variables and see if they are either statically initialised (e.g. bool longsOn = true or int longs = 1) or set in Initialise() or OnStartUp() and change them to start as false/0/Off whatever.

Finally just press F5, this will recompile your new Strategy and any other code you have. Close the file and you should be good to go.

Re-edit/F5/find errors as needed, you only need the 'Save As...' step if you want different named versions.

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
danyzuko
San Antonio TX/USA
 
Posts: 15 since Jan 2015
Thanks Given: 12
Thanks Received: 3

Thank you but after looking at the edit strategy as you mentioned the strategy doesn't appear in that list.

Here is a screenshot showing both the strategies dialog and the edit strategy as well. Please advise...
https://gyazo.com/449010941bb84e34aaf88f6042702b13

Reply With Quote
Thanked by:
  #5 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


danyzuko View Post
Thank you but after looking at the edit strategy as you mentioned the strategy doesn't appear in that list.

Here is a screenshot showing both the strategies dialog and the edit strategy as well. Please advise...
https://gyazo.com/449010941bb84e34aaf88f6042702b13

Is it a protected DLL or do you have the .cs file?

How was it installed into your system?

What shows when you add it to a chart normally?

Might need somebody else who's used to dealing with 3rd party strats to chime in here, I don't use them.

Cheers

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
 
trendwaves's Avatar
 trendwaves 
Florida
Legendary Market Wizard
 
Experience: Advanced
Platform: NinjaTrader 8
Trading: ES, NQ, CL
Posts: 703 since Dec 2012
Thanks Given: 2,898
Thanks Received: 2,525

If he can get at the source code, (from the looks of it he can't), but for future reference... just check for the Historical state at the top of OnBarUpdate() forcing an exit until the strategy transitions to the live state. He won't have access to historical performance statistics, but the strategy will always start clean on the first tick of live data, (no virtual positions/orders as a result of the historical state) .

 
Code
if (Historical) return;

Be Patient and Trade Smart
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
danyzuko
San Antonio TX/USA
 
Posts: 15 since Jan 2015
Thanks Given: 12
Thanks Received: 3

Yeah I'm afraid it must be protected. And I can't find any .cs files with the strategy I need to change. I resorted to using a macro to quickly disable both the long and short buttons as the strategy comes on. But recently even the macro is failing with a message saying, "unable to set the hook". I take it that's some sort of VB or .net issue.

I recently upgraded to windows 10 and lost the ability for any macro programs to work anymore. Ugh..

Reply With Quote
Thanked by:
  #8 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


danyzuko View Post

I recently upgraded to windows 10 and lost the ability for any macro programs to work anymore. Ugh..

Yep, that's why I haven't upgraded. I know lots of folks say 10's great but I never do until I buy a new machine to go with it. I think there's a way to restore 7 but I don't know how easy it is.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #9 (permalink)
 
ratfink's Avatar
 ratfink 
Birmingham UK
Market Wizard
 
Experience: Intermediate
Platform: NinjaTrader
Broker: TST/Rithmic
Trading: YM/Gold
Posts: 3,633 since Dec 2012
Thanks Given: 17,423
Thanks Received: 8,425


trendwaves View Post
If he can get at the source code, (from the looks of it he can't), but for future reference... just check for the Historical state at the top of OnBarUpdate() forcing an exit until the strategy transitions to the live state. He won't have access to historical performance statistics, but the strategy will always start clean on the first tick of live data, (no virtual positions/orders as a result of the historical state) .

 
Code
if (Historical) return;

Yes I do use that quite a lot too, but I think he wants the strategy to go live and then to be able to manually hit the Longs/Shorts On/Off buttons from a default 'Off' state rather than from a default 'On' state.

Travel Well
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #10 (permalink)
danyzuko
San Antonio TX/USA
 
Posts: 15 since Jan 2015
Thanks Given: 12
Thanks Received: 3


Yes he's right Trendwave. I wasn't sure what you were advising. But my case is exactly as Ratfink stated.
That's fine. I got an alternate strategy to work the way I want it to and it has all the necessary functionality.

Reply With Quote
Thanked by:




Last Updated on January 22, 2016


© 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