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 cmtjoancolmenero, Yesterday, 03:58 PM
      8 responses
      31 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by helpwanted, Today, 03:06 AM
      2 responses
      21 views
      0 likes
      Last Post NinjaTrader_LuisH  
      Started by DayTradingDEMON, Today, 09:28 AM
      0 responses
      8 views
      0 likes
      Last Post DayTradingDEMON  
      Started by navyguy06, Today, 09:28 AM
      0 responses
      2 views
      0 likes
      Last Post navyguy06  
      Started by rjbtrade1, 11-30-2023, 04:38 PM
      2 responses
      77 views
      0 likes
      Last Post DavidHP
      by DavidHP
       
      Working...
      X