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 MGHORBEL, Today, 06:25 AM
        1 response
        14 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by 1001111, Today, 01:35 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by tradingnasdaqprueba, Yesterday, 03:42 AM
        11 responses
        40 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by haas88, 03-21-2024, 02:22 AM
        14 responses
        178 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by Skifree, Yesterday, 11:41 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Working...
        X