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 junkone, Today, 11:37 AM
            2 responses
            12 views
            0 likes
            Last Post junkone
            by junkone
             
            Started by frankthearm, Yesterday, 09:08 AM
            12 responses
            43 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by quantismo, 04-17-2024, 05:13 PM
            5 responses
            35 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by proptrade13, Today, 11:06 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            35 views
            0 likes
            Last Post love2code2trade  
            Working...
            X