Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

NinjaTrader completely collapses

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    NinjaTrader completely collapses

    Hello dear friends of NinjaTrader,

    i have been trying to finish a strategy for quite a long time but im unable because for some reason NinjaTrader stops working, closes itself and is impossible to reopen unless you reinstall it. The code is finished except the datetimes. when i try to insert the datetime to finish the code, the code compiles correctly but when i click "strategy" after the right click on the chart, what i wrote previously happens and when i try to reopen NinjaTrader i get the error on the image and it stops working again (i can open it again only after deleting the strategy from the NinjaTrader 8 folder in documents folder and reinstalling NinjaTrader . Any idea why?

    i have tried defining 2 datetimes both as private and public, but i still get the same error.

    Apparently these is the only lines that create the error:
    DateFrom = DateTime.Parse("05/05/2017 4:10:00 PM");
    DateTo = DateTime.Parse("05/05/2017 4:15:00 PM");

    or this, defining them before "protected override void OnStateChange()"

    private DateTime DateFrom = DateTime.Parse("05/05/2017 4:10:00 PM");
    private DateTime DateTo = DateTime.Parse("05/05/2017 4:15:00 PM");


    Click image for larger version

Name:	Error 20_12_2021 20_20_37.png
Views:	141
Size:	3.7 KB
ID:	1182397

    im not very good at coding so there's probably something wrong but i have no idea what it is.
    kind regards​

    #2
    Hi solotiempopls, thanks for posting.

    Please first confirm the parsing method is returning a non-null object e.g.

    Print(DateTime.Parse("05/05/2017 4:10:00 PM")); //view output from New>NinjaScript Output

    You can also use Visual Studio debugging to automatically break at the line that is causing the exception:


    I look forward to hearing of your results.
    Chris L.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by James650, 05-07-2024, 08:25 AM
    3 responses
    14 views
    0 likes
    Last Post NinjaTrader_ChristopherJ  
    Started by xepher101, 05-10-2024, 12:19 PM
    5 responses
    66 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Vitamite, Yesterday, 12:48 PM
    3 responses
    18 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by aligator, Today, 02:17 PM
    0 responses
    17 views
    0 likes
    Last Post aligator  
    Started by lorem, 04-25-2024, 09:18 AM
    22 responses
    96 views
    0 likes
    Last Post lorem
    by lorem
     
    Working...
    X