Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ArrowLine End Bar

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

    ArrowLine End Bar

    Hello support --

    I used the following code to draw arrowline

    Execution eX;
    ent_time = eX.Time;
    double enter_double = eX.Price;
    DateTime bb = Time[20];
    IArrowLine enterArr = DrawArrowLine("enter", false, bb, enter_double+0.30, enter_time_dt, enter_double, Color.Crimson, DashStyle.Solid, 3);

    But some times the end of the arrow is placed on the one bar earlier then the bar of execution.

    What is the reason? How fix it?

    Thx

    #2
    Does this happen in real-time, or during backtesting?

    Is it your bb, or enter_time_dt which is off bar a bar? Or are they both shifted by one?

    How is enter_time_dt calculated? Is it also based from the execution event?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Hi Matthew --

      Actualy

      string enter_time = list_view.SelectedItems[0].SubItems[5].Text;
      DateTime enter_time_dt = DateTime.Parse(enter_time);

      but i think i doesn't matter.

      Some times the start bar and the end bar of arrow line are shifted, some times the end only

      Comment


        #4
        This is likely the timing of the fills. Please see the following thread which dicusses this in detail and let me know if you have any questions:

        Support for the development of custom automated trading strategies using NinjaScript.


        If you can clarify the condition in which it sometimes happens (real-time vs backtest) I'll be happy to offer further clarification.
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        82 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        43 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        68 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        56 views
        0 likes
        Last Post CarlTrading  
        Working...
        X