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

Help Recognizing New Rays

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

    Help Recognizing New Rays

    Hi, I started editing code on this indicator to expose the swing plots so it can be used for a strategy. It's based on Ninjatrader's swing indicator and it plots highs and lows that extend until broken. When I tried implementing it in a strategy, it only recognized only the first high or low that plotted on a chart. I need the most recent swing high or low to be recognized and not just the first swing high or low that occurs.

    I added the two new data series on line 29 and 30. They are initialized as a class on lines 58 and 59. I also set it as a double in lines 135 and 195. And finally, I added the data series to the properties in lines 210 and 217.

    I can't tell what I've done wrong here but no strategy I use this indicator with can identify the most recent swing high or low with this code. Can you tell me what I did wrong? I tried using the Ninjatrader Swing indicator as a reference because I know that works well. I can't figure out what I did wrong here.

    (The indicator is publicly available by the way. I just need help on a slight modification I'm making because the old code was incomplete)
    Attached Files

    #2
    Hello khari998,

    Thank you for your note.

    In the support department at NinjaTrader we do not create, debug, or modify code for our clients. This is so that we can maintain a high level of service for all of our clients.

    I would suggest seeing the following example for which demonstrates three different ways to expose a data series to a strategy. You could compare your current script to the script at the link as a means of debugging your script.



    I would suggest adding print statements to your indicator to confirm desired values are being set to a series within the indicator, and thus can be referenced. I’ve provided a link to a youtube video which covers an example of using prints to understand behavior:

    Dive into manipulating C# code from within an unlocked NinjaScript strategy using the NinjaScript Editor.NinjaTrader 7 is an award winning end to end online ...


    If you’d like I could have someone from our business development team pass over a list of third party developers that you could contact about debugging your code.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Kaledus, Today, 01:29 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by frankthearm, Yesterday, 09:08 AM
    13 responses
    45 views
    0 likes
    Last Post frankthearm  
    Started by PaulMohn, Today, 12:36 PM
    2 responses
    16 views
    0 likes
    Last Post PaulMohn  
    Started by Conceptzx, 10-11-2022, 06:38 AM
    2 responses
    55 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Started by yertle, Yesterday, 08:38 AM
    8 responses
    37 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Working...
    X