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

Swing Indicator NT8

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

    #16
    Hello Mukaddim,

    Thanks for your reply.

    We do not recommend or support dynamic instrument assignments. Your MTF would need to be hard coded for the time frames to use. I don't know if this would be an option but you could add all of the time frames of interest and then in the code use bools to not process certain time frames (the indicator would still load all of the time frame data though). The bools could be exposed as public settable to create the ability to select the time frames from the UI. We would not have any examples of this type of coding.

    If you wish to code a multi time frame script, please make sure you review this section of the help guide: https://ninjatrader.com/support/help...nstruments.htm

    If you would like the indicator created or modified, we can provide references to 3rd party programmers who can perform this service.
    Paul H.NinjaTrader Customer Service

    Comment


      #17
      Hi PaulH,
      Thanks for your response. Figured the MTF issue already, thanks so very much.

      Comment


        #18
        a) Is there an indicator or way to alter the Swing indicator to see the the swing price plotted when it is actually detected/confirmed (e.g., X bars past the swing high/low)? I have used 3rd party software that copies the Swing indicator and plots the swings starting at the time they are confirmed instead of the actual swing high/low, but it seems like there ought to be something more direct.
        b) How would I set a variable based on whether the most recent swing was a high or low? My goal is to filter other setups to only longs or short based on the most recent pivot. I am a hack, but have tried setting Direction to 1 when the confirmed (by 3rd party copy of Swing indy) Swing Low is different than the prior bar, and -1 when Swing High is different than the prior bar, but in testing using background colors, it's painting the entire chart based on most recent swing rather than painting bars after a swing low different than the bars after a swing high. Help!!!???

        else if (State == State.DataLoaded)
        {
        Swing1 = Swing(Close, Convert.ToInt32(SwingStrength));
        Markers_Copy1 = Markers_Copy(Swing1.SwingLow, 0, @"swing_low", 0, false, false);
        Markers_Copy2 = Markers_Copy(Swing1.SwingHigh, 0, @"swing_high", 0, false, false);
        }
        }

        protected override void OnBarUpdate()
        {
        if (BarsInProgress != 0)
        return;

        if (CurrentBars[0] < 1)
        return;

        // Set 1
        if (Markers_Copy1[0] != Markers_Copy1[1])
        {
        Direction = 1;
        BackBrush = Brushes.PowderBlue;
        }

        // Set 2
        if (Markers_Copy2[0] != Markers_Copy2[1])
        {
        Direction = -1;
        BackBrush = Brushes.MistyRose;
        }

        Comment


          #19
          Try using this indicator.

          Comment


            #20
            Hi vickisb, thanks for posting. I made this single dot swing indicator that marks only the bar where the swing was detected:



            The swing has a SwingHighBar and SwingLowBar method. This will tell you the bar number where the last high and low occurred and it can be used to tell what came first.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by AaronKoRn, Yesterday, 09:49 PM
            0 responses
            11 views
            0 likes
            Last Post AaronKoRn  
            Started by carnitron, Yesterday, 08:42 PM
            0 responses
            10 views
            0 likes
            Last Post carnitron  
            Started by strategist007, Yesterday, 07:51 PM
            0 responses
            12 views
            0 likes
            Last Post strategist007  
            Started by StockTrader88, 03-06-2021, 08:58 AM
            44 responses
            3,982 views
            3 likes
            Last Post jhudas88  
            Started by rbeckmann05, Yesterday, 06:48 PM
            0 responses
            10 views
            0 likes
            Last Post rbeckmann05  
            Working...
            X