Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

NT8 "Draw.Line" problems

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

    NT8 "Draw.Line" problems

    Hi NT-Community,

    in NT7 I have these kinds of code snippets to make the automated strategy doings visible for me in the NT Strategy Analyzer:

    if ( ord_StopLoss != null )
    DrawLine(" StopLoss DashLine " + CurrentBar, false, 0 , dou_StopLossPrice, 1 , dou_StopLossPrice, Color.Red, DashStyle.Dash, 1);

    Explanation: ord_StopLoss is the StopLossOrder of the stratgsy. This DrawLine shows me where the StopLoss Order was. It makes a Dash on every OnBarUpdate as long as StopLossOrder is in the market.


    Unfortunately there have been some changes in NT8. I've done this adaptation with the help of the NT code breaking changes list:

    if ( ord_StopLoss != null )
    Draw.Line(this, " StopLoss DashLine " + CurrentBar, false, 0 , dou_StopLossPrice, 1 , dou_StopLossPrice, Brushes.Red, DashStyleHelper.Dash, 1);

    Result: Well the last code snippet in NT8 hasn't worked out in the way like it was in NT7. It seems that nothings happens..

    My Question: Which changes do I have to make in the last code snippet to produce a Dashline on every OnBarUpdate?


    Many thanks for help
    Last edited by Redmoon22; 10-08-2016, 04:53 AM.

    #2
    Hello,

    Thank you for the question.

    To better understand if the object is being drawn at all, could you access the Right click menu -> Drawing Tools -> Drawing objects... menu to see if the object is listed?

    This would be a good first step to see if it is being drawn, you could also see at what value in case it is plotting at 0 or a value out of the visible area. You are using AutoScale = false so this could be the case.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alifarahani, Today, 09:40 AM
    6 responses
    24 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    17 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by Kaledus, Today, 01:29 PM
    5 responses
    13 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    17 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X