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 poplagelu, Today, 05:00 AM
      0 responses
      3 views
      0 likes
      Last Post poplagelu  
      Started by fx.practic, 10-15-2013, 12:53 AM
      5 responses
      5,407 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by Shai Samuel, 07-02-2022, 02:46 PM
      4 responses
      98 views
      0 likes
      Last Post Bidder
      by Bidder
       
      Started by DJ888, Yesterday, 10:57 PM
      0 responses
      8 views
      0 likes
      Last Post DJ888
      by DJ888
       
      Started by MacDad, 02-25-2024, 11:48 PM
      7 responses
      160 views
      0 likes
      Last Post loganjarosz123  
      Working...
      X