Announcement

Collapse
No announcement yet.

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 vantojo, Today, 06:46 AM
            0 responses
            3 views
            0 likes
            Last Post vantojo
            by vantojo
             
            Started by sidlercom80, Today, 02:40 AM
            1 response
            14 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by b16_aln, Today, 01:52 AM
            0 responses
            14 views
            0 likes
            Last Post b16_aln
            by b16_aln
             
            Started by junkone, Yesterday, 08:55 PM
            2 responses
            13 views
            0 likes
            Last Post junkone
            by junkone
             
            Started by adaeiqendqw, 01-16-2021, 02:56 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_Jason  
            Working...
            X