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

Simple Renko Trading system

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

    Simple Renko Trading system

    I am newbie to Ninjatrader. Does anyone have a simple Renko trading robot and willing to share? I would like to develop a robot per rule below using renko chart; Please help.how to do that.

    Input:
    1. Renko box size
    2. Trading hours
    3. Sl and tp
    4. Consecutive lost trade count to suspend automatically trading (default 3)
    5. Suspend automatically trading for minutes (default 30)
    Long trade rules
    1. Last Renko bar is bull bar and no long trade exists.
    2. Close existing short trade if any, or if no short trade existed delete any pending long order if any.
    3. Place a long pending limit trade with pending price as last bar close price – (half brick size + spread)
    Short trade rules
    1. Last Renko bar is bear bar and no short trade exists.
    2. Close existing long trade if any, or if no long trade existed delete any pending short order if any.
    3. Place a short pending limit trade with pending price as last bar close price + (half brick size + spread)
    Suspend automatically trading
    If it had preset ( say 3) consecutive lost trades, automatically trading will be suspending for preset minutes. After preset minutes, automatically trading will resume.

    #2
    Hello xlitang,

    Thank you for the post.

    If any members of the forum have something they would like to share, they will certainly post it here. This is the NinjaScript development forum which is generally used to discuss how you can develop NinjaScript items. Is this something you are trying to create yourself and also wanted resources related to NinjaScript programming, or is this something you are looking to outsource and have created for you?

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for you r reply. how do I write script to check if there is any pending order or open order exist?

      Comment


        #4
        Hello xlitang,

        In relation to a NinjaScript straetgy, this would be observed using the OnOrderUpdate override. We have a sample that uses this override here:

        https://ninjatrader.com/support/help...and_onexec.htm

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Hello,what a coincidence! I've begun working on creating a strategy that sounds VERY similar. Just a logic/flowchart so far and a very rudimentary strategy, which I haven't yet gotten to function.
          Mine was just gonna "keep going" until I manually stopped it from running, but your idea of limiting the losses sounds much more prudent. Would like to collaborate with someone with a similar goal. -Bill-

          Comment


            #6
            What is wrong with the code below? the pending limit price is not correct? Renko brick size is 10. Please advice.

            // Set 1
            if (Close[1] > Open[1])
            {
            EnterLongLimit(Convert.ToInt32(DefaultQuantity), (Close[0] - 5) , "");
            }

            // Set 2
            if (Close[1] < Open[1])
            {
            EnterShortLimit(Convert.ToInt32(DefaultQuantity), (Close[0] + 5) , "");
            }
            Last edited by xlitang; 07-12-2019, 06:35 AM.

            Comment


              #7
              Hello xlitang,

              Thank you for the post.

              What price are you expecting here? Was this intended to be the close minus 5 ticks? If so, that would be Close[0] - 5 * TickSize

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Thanks Jesse.

                For example, brick size is 10 and the closed price of instrument is now 12322 and is a bull bar. I would like to place a buy limit order at the price of 12317 (half brick size below closed price), for bear bar, I would like to place a sell limit order at the price of half brick size above closed price which is 12327.

                Comment


                  #9
                  Hello xlitang,

                  Yes in that case you could use what I suggested: Close[0] - 5 * TickSize or Close[0] + 5 * TickSize. This would return +/-5 ticks from Close for the current instrument. When you add or subtract that from the price, it would equate to the price plus or minus 5 ticks. If you are using a 10 tick renko bar, 5 ticks would be half.

                  I look forward to being of further assistance.
                  JesseNinjaTrader Customer Service

                  Comment


                    #10
                    Thanks again. Why I can't edit the code in Ninjascript Editor?

                    Comment


                      #11
                      Hello xlitang,

                      Are you seeing an error? Can you provide more details on what specifically you are trying that is not working?

                      I look forward to being of further assistance.
                      JesseNinjaTrader Customer Service

                      Comment


                        #12
                        no error, looks like the code is locked and I can't make change.

                        Comment


                          #13
                          Hello xlitang,

                          Are you trying to edit a locked system script? Any of the files shown in the editor which have a Lock icon cannot be edited directly. you would need to Right click -> Save As from within the file to generate a copy with a new name.

                          I look forward to being of further assistance.
                          JesseNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by bortz, 11-06-2023, 08:04 AM
                          47 responses
                          1,604 views
                          0 likes
                          Last Post aligator  
                          Started by jaybedreamin, Today, 05:56 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post jaybedreamin  
                          Started by DJ888, 04-16-2024, 06:09 PM
                          6 responses
                          18 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by Jon17, Today, 04:33 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post Jon17
                          by Jon17
                           
                          Started by Javierw.ok, Today, 04:12 PM
                          0 responses
                          13 views
                          0 likes
                          Last Post Javierw.ok  
                          Working...
                          X