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 zstheorist, Today, 07:52 PM
            0 responses
            3 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            149 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            5 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            5 views
            0 likes
            Last Post tkaboris  
            Working...
            X