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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    62 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    134 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    75 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    50 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X