Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Editor Compile No Errors But Not Seen In Dropdown Options

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

    Strategy Editor Compile No Errors But Not Seen In Dropdown Options


    RE: Strategy Editor Compile No Errors But Not Seen In Dropdown Options

    Hi folks,

    See the attached strategy that compiles with no errors at all in the editor or the log.

    Yet, when compiled, the strategy does not appear as an option to enable live or in the strategy analyzer

    Could you let me know your thoughts so we can get this to be fixed?



    Greg
    Last edited by birdog; 01-09-2023, 10:16 AM.

    #2
    Hello birdog,

    This script contains two OnBarUpdate methods where only the override method will be executed.

    The variable definitions are inside OnBarUpdate meaning they get reset for each bar, the variables control the conditions in the second invalid OnBarUpdate. If we assume you combined that code into 1 OnBarUpdate it still wont work based on how the variables are defined. It may contain other problems in the two sets of OnBarUpdate logic, you would need to add Print statements to check how it works after fixing the structure of the file.​

    The code provided is invalid.

    Code:
    void OnBarUpdate(
    {
    ....
    }
    The code that is inside this would be assumed to be in the real OnBarUpdate method which is

    Code:
    protected override void OnBarUpdate()
    {
    }

    Based on the filename if this came from the chatgpt chatbot then I would not suggest using that for NinjaScript examples, it does not have the context needed to make valid files. From other user questions on that topic the scripts that I have seen have all contained many errors and required steps to debug or fix them. If you are good at C# debugging/development and are already well versed in NinjaScript you can use that tool for suggestions on how to do things as long as you can spot the errors in the code and structure it makes. Our support cannot debug scripts for you so using generated samples would be something you can use it as long as you can debug the results it gives you.









    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X