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

Draw Line

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

    Draw Line

    Hi All,

    I'm having trouble drawing a line in my strategy. I want the line to start on the first bar of the session and continue for 40 bars. I wrote the following statement, but I'm getting an error:

    if(Bars.BarsSinceNewTradingDay < 40)
    {
    Draw.Line("this", topLine.ToString(), false, Bars.BarsSinceNewTradingDay, SecHigh,
    0, SecHigh, Brushes.Green, DashStyleHelper.Solid, 2);
    The only item in the statement above I'm not sure about is the "Bars.BarsSinceNewTradingDay" for the startBarsAgo parameter.

    I also thought about using DateTime as the starting / ending points of the line, but since the start of the trading day starts in one day and ends on the following day, I'm having problems there as well.

    Any help is greatly appreciated.

    #2
    Originally posted by GeoOrtiz View Post
    Hi All,

    I'm having trouble drawing a line in my strategy. I want the line to start on the first bar of the session and continue for 40 bars. I wrote the following statement, but I'm getting an error:



    The only item in the statement above I'm not sure about is the "Bars.BarsSinceNewTradingDay" for the startBarsAgo parameter.

    I also thought about using DateTime as the starting / ending points of the line, but since the start of the trading day starts in one day and ends on the following day, I'm having problems there as well.

    Any help is greatly appreciated.
    Are there any error messages, anywhere, such as in your log?

    Comment


      #3
      Yes, I get a "CS1502" error

      Comment


        #4
        Hello GeoOrtiz,

        What is the full text of the error message?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by GeoOrtiz View Post
          Yes, I get a "CS1502" error
          Cross-check your syntax by comparing it to what is in the NT Help. That is certainly a syntax error.

          Comment


            #6
            Ok, figured out the problem. I put quotation marks on this. Once I corrected that, it all worked well.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by traderqz, Today, 12:06 AM
            2 responses
            3 views
            0 likes
            Last Post traderqz  
            Started by RideMe, 04-07-2024, 04:54 PM
            5 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by f.saeidi, Today, 08:13 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by DavidHP, Today, 07:56 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Erick  
            Started by kujista, Today, 06:23 AM
            3 responses
            11 views
            0 likes
            Last Post kujista
            by kujista
             
            Working...
            X