• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 ArmKnuckle, Today, 01:59 AM
                          1 response
                          15 views
                          0 likes
                          Last Post NinjaTrader_PaulH  
                          Started by seppyr, Today, 01:53 AM
                          1 response
                          17 views
                          0 likes
                          Last Post NinjaTrader_PaulH  
                          Started by matthewbartlett, Today, 01:22 AM
                          1 response
                          8 views
                          0 likes
                          Last Post Emma1
                          by Emma1
                           
                          Started by ct_fx, Today, 05:14 AM
                          0 responses
                          12 views
                          0 likes
                          Last Post ct_fx
                          by ct_fx
                           
                          Started by Beauregard, Today, 04:36 AM
                          0 responses
                          9 views
                          0 likes
                          Last Post Beauregard  
                          Working...
                          X