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

Need help with Strategy Building

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

    Need help with Strategy Building

    Hi,

    I have made a strategy to go long and short according to the colour change of Renko bars. Now I need to filter it with N bars up and down indicators. I want my strategy not to place any order when there is no vertical lines in both N bars up and Down indicators. I need some help with that please.

    #2
    Hello asmmbillah,

    Welcome to the forums!

    The NBarsUp and NBarsDown indicators can be referenced for NinjaScript usage in our help guide.

    Checks for n number of consecutive higher closes. Returns a value of 1 when the condition is true or 0 when false.
    I have also included the parameters that will be seen in the Strategy Wizard:
    Parameters

    barCount - The number of required consecutive higher closes
    BarUp - Each bar's open must be higher than the close; true or false
    higherHigh - Consecutive higher highs required; true or false
    higherLow - Consecutive higher lows required; true or false
    Code:
    // Checks if we have 3 consecutive higher closes
    double value = NBarsUp(3, true, true, true)[0];
    
    if (value == 1)
       Print("We have three consecutive higher closes);
    I may suggest setting up the logic as seen in the help guide to observe the expected behavior and then to model the strategy logic once you are familiar with the way the indicator works.

    If you have not already, I would also recommend viewing the Strategy Wizard 301 tutorial for a complete walkthrough for creating a strategy with this tool.

    Strategy Wizard 301 - https://www.youtube.com/watch?v=FmBiNYsf1e8

    NBarsUp and NBarsDown indicators can be referenced below.

    NBarsUp - https://ninjatrader.com/support/help.../n_bars_up.htm

    NBarsDown - https://ninjatrader.com/support/help..._bars_down.htm

    Please let us know if you have any questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi,

      Thanks for your reply.
      I have read the materials in the links and watched the video. My question is, I want my strategy to place order when green bars changed into red, but not to place any new orders if there is no bars shown on N bars up and down indicators. If you could help me with any example pls.

      Comment


        #4
        Hello asmmbillah,

        Thanks for your reply.

        Creating trading logic as well as creating modifying and debugging client code exceeds the scope of service we can offer in the support department. This is because we are a small team and cannot take on the bandwidth to fulfill these requests for all of our clients. If you are looking for such services, I can have a representative of our EcoSystem write back with additional information on NinjaScript Consultants who would be happy to create this strategy or any piece of logic desired for your needs.

        To answer your question, you may consider the following:

        A green bar is created when the Close is greater than the Open and a red bar is created when the Close is less than the Open. You could set a bool when Close > Open and then when the Close is less than open and this bool is true, you then know bars have changed from green to red.

        You could also create logic checking a certain number of bars ago to see if they were red or green to further define your logic.

        For example, the current bar is red and the last two bars are green: Close[0] < Open[0] && Close[1] > Open[1] && Close[2] > Open[2]...

        This logic could set a bool that you can use alongside a bool for "if there is no bars shown on N bars up and down indicators" to control your order entries.

        I've included an additional document that goes further into detail on barsAgo references.

        Working with Price Series - https://ninjatrader.com/support/help...rice_data2.htm

        Please let us know if we can provide further assistance.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hi,

          Thanks again. yes, if you could let advise one of Echosystem representative to contact me with details of Ninjascript consultant would be very helpful.

          Comment


            #6
            Hello asmmbillah,


            Thank you for contacting us and for your interest in NinjaTrader!


            You can search our extensive library of vendors who provide programming services through the link below. Simply enter a consultant name or search by using our filter categories. Once you have identified your consultants of choice, please visit each consultant's site for more information or contact them directly to learn more!





            You can locate the contact information for the consultants on their direct websites for any additional questions you may have. Since these consultants are third party services for NinjaTrader all pricing and support information will need to be obtained through the consultant.


            This NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The companies and services listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.


            Please let me know if you have any questions, concerns or if I can provide any further assistance by responding to this thread at your convenience.
            Ryan L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by bmartz, 03-12-2024, 06:12 AM
            5 responses
            33 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by Aviram Y, Today, 05:29 AM
            4 responses
            13 views
            0 likes
            Last Post Aviram Y  
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            28 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X