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

How to define High[0]=resistance level1 of DynamicSRLines in strategy builder?

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

    How to define High[0]=resistance level1 of DynamicSRLines in strategy builder?

    Dear Team,
    Thank you so much for your help,so many times!

    I'm using DynamicSRLines https://ninjatraderecosystem.com/use...amicsrlines-2/ indicator in my strategy.

    But I have no idea how to define High[0]=resistance leave 1 of DynamicSRLines in strategy builder? There is no option of levels.

    Can you give me some advise,I don't want to code,I want to stay with strategy builder,because it is easier and convenient.But If strategy builder doesn't have the function,I will modify the code then.

    #2
    Hello williamzz,

    The indicator you linked uses Drawing Objects to display its values, this could not be used as a strategy signal from the builder. You would need to manually code the strategy to access the objects in realtime, or the indicator would need to be programmed to have plots instead of using drawing objects. The correct solution I could suggest for this to be used would be to reprogram it to have plots.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you very much for reply!It is really helpful!Can you give me some guide about how to reprogram it to have plots?I know some coding.

      Comment


        #4
        Hello williamzz,

        From what I can see the way it draws is pretty straightforward, it just supply's calculated values to the drawing objects. It does wait until the last bar to draw so that is more difficult to account for. This is something you would likely need to modify so this processes the levels on each bar rather than waiting until the last bar. That would allow it to work historically or how the strategy is expecting the signal to work. Due to how this was programmed, it may be easier to take the calculations from this indicator and make a new one of your own. I say this because it is generally easier to start from scratch than try to reverse engineer something which had a different intended purpose. The calculations will likely still apply there and will remove the unnecessary logic by more closely picking out what logic is actually needed.

        The way it is now you could make a plot going forward, but in historical data this would not work as expected. This is because the Count of bars is being used and this would be known ahead of time in historical data.

        One way to display the value as a plot would be to add a plot and then do a loop like the following:

        On line 141:
        Code:
        for(int i = 0; i < Count - 2; i++)
        {
           Value[i] = p+((ZoneTickSize*TickSize)/2);
        }
        This would use one of the values the drawing objects currently do to display a plot. The loops is needed due to how the indicator is currently programmed, it is needed to plot a historical value to see the plot show up. The Value[i] syntax and loop could be replaced by a Value[0] = syntax so long as the outer conditions using Count is removed/modified.

        I look forward to being of further assistance.


        JesseNinjaTrader Customer Service

        Comment


          #5
          Thank you very much Jesse,but this code doesn't work.I add it into line 141,nothing happened in the strategy builder.

          Comment


            #6
            Hello williamzz,

            What do you mean nothing happened in the builder? What did you try?

            I had noted that code will not work for historical trades, were you expecting historical trades to happen when you ran it?

            The code I provided was just a sample of how you may be able to expose the data, this is not likely all that would be needed to use the data in a strategy. I provided some notes in my last post as to why that would be the case.

            Please let me know if I may be of additional assistance.

            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kujista, Today, 05:44 AM
            0 responses
            5 views
            0 likes
            Last Post kujista
            by kujista
             
            Started by ZenCortexCLICK, Today, 04:58 AM
            0 responses
            5 views
            0 likes
            Last Post ZenCortexCLICK  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            172 responses
            2,281 views
            0 likes
            Last Post sidlercom80  
            Started by Irukandji, Yesterday, 02:53 AM
            2 responses
            18 views
            0 likes
            Last Post Irukandji  
            Started by adeelshahzad, Today, 03:54 AM
            0 responses
            8 views
            0 likes
            Last Post adeelshahzad  
            Working...
            X