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

SWINGS Above/Below MA

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

    SWINGS Above/Below MA

    Trying to build an indicator that labels Swing High & Low points above or below a user defined moving average. All current swing related indicators base the swing points on "Strength" or number of bars! In my mind, that doesn't present proper swings.

    I would like to define a new swing would be if price closed for two consecutive bars above or below a MA.

    I've made attempts to modify the SWING & ZigZag indicators but can't locate where within the code could I replace (strength) or add " && Close[0] > MA(input)[0]"

    I've have been searching for a while and can't find the right information so I'm asking any NT Support Members for help.

    Thanks in Advance for any & all feedback

    #2
    Hi BryanGriggs,

    Is that the extent of the logic for the swing, or does the logic for the Swing already made need to be incorporated into this as well?

    I ask because, you could very easily create a indicator that checks if the close price is greater than a moving average on the bar and the bar before.

    if (Close[0] > SMA(9)[0] && Close[1] > SMA(9)[1])
    {
    // execute code to mark swing
    }



    For help with logic, I recommend that you contact a professional NinjaScript Consultant who would be happy to assist you with the logic side of NinjaScript creation.

    Below is a publicly available link to a list of NinjaScript Consultants.
    http://ninjatraderecosystem.com/Part...ultants.php#81


    This thread will remain open for any community members that would like to assist.

    Comment


      #3
      Wesley,

      Thanks for your reply.

      To make myself clear, we will use the Swing indicator for example.

      I want to use the Swing indicator but add to the code for the MA variable.

      So the Swing indicator would work as it does now

      IF "((what ever code or strength here is met)"

      && (Close[0] > SMA(9)[0] && Close[1] > SMA(9)[1]))

      So the criteria for the MA would be added to the code for the Swing indicator.

      I welcome any ideas, Thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by RookieTrader, Today, 09:37 AM
      3 responses
      15 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by kulwinder73, Today, 10:31 AM
      0 responses
      5 views
      0 likes
      Last Post kulwinder73  
      Started by terofs, Yesterday, 04:18 PM
      1 response
      23 views
      0 likes
      Last Post terofs
      by terofs
       
      Started by CommonWhale, Today, 09:55 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by Gerik, Today, 09:40 AM
      2 responses
      7 views
      0 likes
      Last Post Gerik
      by Gerik
       
      Working...
      X