Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Entry based on X bars ago (Renko)

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

    Entry based on X bars ago (Renko)

    Using a Renko chart, I want to be able to set a limit order to go long at the open of the bar three bars back.

    I know even though each down Renko bar "opens" a tick above/below the close of the previous bar (Bar [0]), it paints a "false" open a set number of ticks above that, for visual purposes, and uses that "false" open for calculations, and that's OK. I want to be able to EnterLongLimit when the current bar actually opens, with the limit price being equal to the open ("false" or real, I don't care as long as I can reference it accurately) of three bars ago (Open[3]).

    Despite the target of "Open[3]", this code does not place the limit order anywhere near the price level of the "false" open three bars ago: EnterLongLimit(2, Open[3], @"LongEntry");

    Obviously something is not correct here; how should I code this to reference three bars back?

    Thanks in advance!
    Last edited by LunaKai; 04-30-2025, 08:56 AM.

    #2
    Hello LunaKai,

    Open[3] would be the open price of 3 bars ago.

    I would recommend that you print the value to verify.


    if (CurrentBar > 3)
    {
    Print(string.Format("{0} | Time[3]: {1}, Open[3]: {2}, GetCurrentAsk(): {3}", Time[0], Time[3], Open[3], GetCurrentAsk()));
    }

    A buy limit should have the limit price below the ask, while a sell limit should have the limit price above the current bid.
    An order on the wrong side of the market will either fill at market price or will be rejected depending on the brokerage.

    I am assuming this is real-time and that you are aware renko bars are not suitable for backtest / historical.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Chelsea, thanks. I think that's it - I'm trying to put a buy limit at a point above current ask and it's filling at the open of the bar (as you described).

      So should I be using EnterLongStopMarket() instead if I want to go long at a price point above current ask?

      Comment


        #4
        Hello LunaKai,

        Yes, a buy stop order must have the stop price above the ask, and a sell stop order must have the stop price below the bid.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Much appreciated as always.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X