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

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 haas88, 03-21-2024, 02:22 AM
        18 responses
        207 views
        0 likes
        Last Post haas88
        by haas88
         
        Started by Board game geek, Today, 02:20 AM
        0 responses
        1 view
        0 likes
        Last Post Board game geek  
        Started by knighty6508, Today, 01:20 AM
        2 responses
        14 views
        0 likes
        Last Post knighty6508  
        Started by franatas, Today, 01:53 AM
        0 responses
        2 views
        0 likes
        Last Post franatas  
        Started by knighty6508, Today, 01:17 AM
        0 responses
        9 views
        0 likes
        Last Post knighty6508  
        Working...
        X