Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-15-2012, 07:17 PM   #1
Atomic
Member
 
Join Date: Jan 2010
Posts: 94
Thanks: 4
Thanked 5 times in 4 posts
Default Importing cs files

I'm helping someone convert strategies written in NinjaScript to EasyLanguage. I have the cs files, which were evidently exported from NT, but I do not see a way to get them back into my NT platform.

Thanks.

Tom
Atomic is offline  
Reply With Quote
Old 05-15-2012, 08:00 PM   #2
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 5,244
Thanks: 411
Thanked 801 times in 774 posts
Default

Hello Tom,

Thank you for your note.

You will have to manually import the .CS files into NinjaTrader.

To do this copy the .CS files and then paste them into the following directory: My Documents\NinjaTrader 7\bin\Custom\Strategy
If they are Indicators it will need to be the following directory: My Documents\NinjaTrader 7\bin\Custom\Indicator

Once complete, go to Tools > Edit NinjaScript > Indicator > select any indicator > OK > once the NinjaScript Editor window opens press F5 on your keyboard to compile your NinjaScript files.

Please let me know if you receive any errors after compiling the NinjaScript files.
NinjaTrader_PatrickH is offline  
Reply With Quote
Old 05-16-2012, 02:40 AM   #3
Atomic
Member
 
Join Date: Jan 2010
Posts: 94
Thanks: 4
Thanked 5 times in 4 posts
Default

Worked great. Thanks.
Atomic is offline  
Reply With Quote
Old 05-26-2013, 01:30 PM   #4
GILAZ
Junior Member
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Smile .cs file use ??

goodnight,
I try to import a file of .cs with your instructions and I see after F5, 2 errors appears
What should I do?
GILAZ is offline  
Reply With Quote
Old 05-26-2013, 01:48 PM   #5
NinjaTrader_PatrickH
NinjaTrader Customer Service
 
NinjaTrader_PatrickH's Avatar
 
Join Date: Jul 2011
Location: Denver, CO, USA
Posts: 5,244
Thanks: 411
Thanked 801 times in 774 posts
Default

Hello GILAZ,

Thank you for your post.

Please follow the instructions below to see where the errors are coming from after compiling the indicator. This will allow you to debug the indicator/strategy or remove it from your PC. If you are wondering why you receive an error when compiling only one indicator, it is because NinjaTrader always compiles all indicators and strategies - not just one. This is done to give you the highest runtime performance possible.
  • Open NinjaTrader
  • From the Control Center select the Tools menu--> select the Edit NinjaScript menu item--> select Indicator
  • Select any indicator and double click on it (we need only to open and compile one script to see all compile errors for all files).
  • A new window will appear and you will need to right click in the window and select Compile to compile the indicators.
  • At the bottom of the window a new section will appear where you can find the error locations.
  • From there you have the option to comment out offending code sections, remove the complete indicator or debug it to be able to compile again.
If you are unsure as to what the error is indicating, please send me a screenshot of the error with the name and description fields clearly readable.

To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CRTL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

We have also collected more comprehensive steps for resolving NinjaScript programming errors in this tip on our forums - http://www.ninjatrader.com/support/f...ead.php?t=4678
NinjaTrader_PatrickH is offline  
Reply With Quote
The following user says thank you to NinjaTrader_PatrickH for this post:
Old 06-22-2013, 05:28 AM   #6
GILAZ
Junior Member
 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 times in 0 posts
Default

Error Message :" protected override void GomOnTermination() "
What I can do now ?
GILAZ is offline  
Reply With Quote
Old 06-24-2013, 08:14 AM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 25,766
Thanks: 432
Thanked 1,683 times in 1,641 posts
Default

GILAZ, would you mind emailing us with the files you tried importing at support at ninjatrader dot com so we could check into further?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-12-2014, 03:32 PM   #8
PanamaJack
Junior Member
 
Join Date: Dec 2012
Location: Houston, Texas
Posts: 20
Thanks: 6
Thanked 1 time in 1 post
Default Errors after trying to compile a .cs file

I tried compiling a .cs file described below but I ended up with errors.
Thanks
PanamaJack
Attached Images
File Type: jpg Errors 6-12-14.jpg (451.7 KB, 7 views)
PanamaJack is offline  
Reply With Quote
Old 06-12-2014, 03:42 PM   #9
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 2,552
Thanks: 38
Thanked 519 times in 512 posts
Default

Hi PanamaJack,

You may have a reference missing to the NinjaTrader.Vendor.dll file.

May I have a screenshot of the References window? (right-click the NinjaScript Editor -> select References)

To send a screenshot press Alt + PRINT SCREEN to take a screen shot of the selected window. Then go to Start--> Accessories--> Paint, and press CTRL + V to paste the image. Lastly, save as a jpeg file and send the file as an attachment.

For detailed instructions please visit the following link
http://take-a-screenshot.org/
NinjaTrader_ChelseaB is offline  
Reply With Quote
The following user says thank you to NinjaTrader_ChelseaB for this post:
Old 06-12-2014, 03:46 PM   #10
PanamaJack
Junior Member
 
Join Date: Dec 2012
Location: Houston, Texas
Posts: 20
Thanks: 6
Thanked 1 time in 1 post
Default Errors after trying to upload a .cs file

Came up blank
Attached Images
File Type: jpg 6-12-2.jpg (26.4 KB, 6 views)
PanamaJack is offline  
Reply With Quote
Old 06-12-2014, 08:27 PM   #11
PanamaJack
Junior Member
 
Join Date: Dec 2012
Location: Houston, Texas
Posts: 20
Thanks: 6
Thanked 1 time in 1 post
Default Errors importing .cs file

I am still having the same issues error messages when I try to load Ninja Script and when I try and compile. Attached a trace document from today 6-12-2014

Thanks,
PanamaJack
Attached Files
File Type: txt trace.20140612.txt (235.5 KB, 1 views)
PanamaJack is offline  
Reply With Quote
Old 06-13-2014, 07:10 AM   #12
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 2,552
Thanks: 38
Thanked 519 times in 512 posts
Default

HI PanamaJack,

All of the system references are missing from this screenshot.

My recommendation is that you remove your configuration file and restart NinjaTrader to recreate it and then add back the NinjaTrader.Vendor.dll file.

You will need to recreate any connections, and re-set any settings you had previously.

To do this:
  • First save your license key to a text file (Help -> License Key...)
  • Shutdown NinjaTrader
  • Delete the file (My) Documents\NinjaTrader 7\config.xml
  • Restart NinjaTrader
  • Enter your license key
  • Click Tools -> Edit NinjaScript -> Indicator -> ADL -> OK
  • Right-click the NinjaScript editor -> select References...
  • Click the Add button -> select NinjaTrader.Vendor.dll -> click Open -> click OK
  • Right-click the NinjaScript editor -> select Compile

Let me know if this does not resolve the errors.
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 06-13-2014, 07:42 AM   #13
PanamaJack
Junior Member
 
Join Date: Dec 2012
Location: Houston, Texas
Posts: 20
Thanks: 6
Thanked 1 time in 1 post
Default Errors on .cs compile

Followed the directions but I still have the errors.
Thanks,
PanamaJack
Attached Images
File Type: png Error 6-13.png (197.3 KB, 4 views)
PanamaJack is offline  
Reply With Quote
Old 06-13-2014, 07:54 AM   #14
NinjaTrader_ChelseaB
NinjaTrader Customer Service
 
NinjaTrader_ChelseaB's Avatar
 
Join Date: Dec 2012
Location: Denver, CO
Posts: 2,552
Thanks: 38
Thanked 519 times in 512 posts
Default

Hi PanamaJack,

These errors look to be specific to the FractalsSRLines and MASLopeMultiV3.42Assy indicators.

Meaning good job, you were able to correct the system references.

So the list of indicators on the right such as anaButterworthFilter1, anaGaussianFilter1, etc... these all seem to be indicators that the MASlopMulti calls.

If you have the original importable packages for the MASLopeMultiV3, my recommendation is to delete any files with this name in the following folder and then compile once they are deleted and use the original importable package to import them again.

(My) Documents\NinjaTrader 7\bin\Custom

Delete any file with the name MASlopMultiV3.


The FractalsSRLines.cs file needs an additional system reference to work that is not added by default. You can delete the FractalsSRLines.cs file and then re-import it, or you can try and add the reference.

The reference needed is System.Design.dll and should be in the folder:
C:\Windows\Microsoft.NET\Framework64\v2.0.507 27\

If you want to delete it and re-import the FractalsSRLines.cs file is in:
(My) Documents\NinjaTrader 7\bin\Custom\Indicator
NinjaTrader_ChelseaB is offline  
Reply With Quote
Old 06-13-2014, 08:33 AM   #15
PanamaJack
Junior Member
 
Join Date: Dec 2012
Location: Houston, Texas
Posts: 20
Thanks: 6
Thanked 1 time in 1 post
Default Errors importing .cs file

If you have the original importable packages for the MASLopeMultiV3, my recommendation is to delete any files with this name in the following folder and then compile once they are deleted and use the original importable package to import them again.
I made it to the compile step and had more errors.
Thanks for the help,
PanamaJack
Attached Images
File Type: jpg Error 6-13 -- 2.jpg (509.8 KB, 4 views)
PanamaJack is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing .cs files JerryA Miscellaneous Support 2 04-11-2012 07:16 AM
importing tick data files JoulVern Connecting 1 12-21-2011 02:49 AM
CS, XML ANd NTD files tpt56 Miscellaneous Support 1 12-12-2011 09:20 PM
Importing txt files Birle Miscellaneous Support 8 12-30-2010 06:03 AM
Importing .csv files buderim Miscellaneous Support 1 07-10-2007 10:19 PM


All times are GMT -6. The time now is 12:35 PM.

FULL RISK DISCLOSURE: Futures trading contains substantial risk and is not for every investor. An investor could potentially lose all or more than the initial investment. Risk capital is money that can be lost without jeopardizing ones financial security or lifestyle. Only risk capital should be used for trading and only those with sufficient risk capital should consider trading. Past performance is not necessarily indicative of future results. View Full Risk Disclosure.