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

The problem with the output signals of the indicator

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

    The problem with the output signals of the indicator

    Good day. I wrote this indicator with two output parameters - Pbuy and Psell.
    Here it is



    But when I tried to call them in the strategy, the signals no longer overlap. Then I decided to write an indicator that would display these two parameters directly as a curve.
    Just like this



    And this is what I saw



    That is, these two output parameters (Pbuy and Psell) simply copy the price value, although everything works fine in the original indicator.
    In the original indicator I use the - Displacement parameter, maybe the conflict arises because of it? Although I don't know how that could be connected.
    Please help to understand as I have this problem for the first time.

    Forgot to add that to build the signals I used a loop, something like this

    var x = new double[N];
    for (var i = 0; i < N; i++)
    {
    Psell[i] = .........;
    }

    For the second signal the same thing
    And in Properties prescribed here is so...

    #region Properties
    [Browsable(false)]
    [XmlIgnore]
    public DataSeries Pbuy
    {
    get { return Values[0]; }
    }

    [Browsable(false)]
    [XmlIgnore]
    public DataSeries Psell
    {
    get { return Values[1]; }
    }
    Last edited by Papercut110; 08-26-2018, 11:04 PM.

    #2
    Hello Papercut110,

    Thank you for the post.

    You noted that you are using the displacement property, but this is only used for visuals but would not affect the underlying data. If you do not use the displacement do the plots still overlap?

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

    Comment


      #3
      NinjaTrader_Jesse, tried, but unfortunately it does not help
      here is the version without displacement

      Comment


        #4
        Hello Papercut110,

        Yes, I would expect the displacement to not change the result in that specific test. What I would be more interested in would be the indicator by its self, do you still see crosses visually when not using displacement and only the indicator?

        For example, you provided this image of only the indicator: https://prnt.sc/kmy66c

        Is this using displacement in that image? If so, what happens when you do not use displacement, do the values still cross?

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

        Comment


          #5
          Hello, NinjaTrader_Jesse, in this screenshot, displacement 18



          and here is the screenshot without displacement



          I do not understand why the indicator displays values despite the fact that the conditions for the signal are not met

          Comment


            #6
            Hello Papercut110,

            Thank you for doing that.

            Now that you have just the indicator and 0 displacements, you would be observing what the other script would.

            Why the plots are showing up when they are not supposed to would be determined by your logic. This is also something you would need to debug the script to find why.

            Now that you are in a point where the script is similar to what the strategy would see, you can add Prints or further simplify the script to find the answer. I would likely suggest making a more simple test of plotting and calling that plot from another script to see if this is related to your looping logic.

            One test would be to take the logic of the SMA and how it plots across all bars and check if your script can call that logic successfully. If so, then you can further complicate it and make it more similar to your current script to find the problem. I do see from your images that your plots are not continuous and have breaks or N/A values which make some comparisons invalid. This is something you can check by using Prints on each bar before your condition. we have a short guide to using prints here.

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

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Lumbeezl, 01-11-2022, 06:50 PM
            31 responses
            817 views
            1 like
            Last Post NinjaTrader_Adrian  
            Started by xiinteractive, 04-09-2024, 08:08 AM
            5 responses
            14 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by swestendorf, Today, 11:14 AM
            2 responses
            6 views
            0 likes
            Last Post NinjaTrader_Kimberly  
            Started by Mupulen, Today, 11:26 AM
            0 responses
            7 views
            0 likes
            Last Post Mupulen
            by Mupulen
             
            Started by Sparkyboy, Today, 10:57 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X