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 Franck Z, Today, 09:49 AM
            0 responses
            5 views
            0 likes
            Last Post Franck Z  
            Started by pvtrader, Today, 08:02 AM
            2 responses
            7 views
            0 likes
            Last Post pvtrader  
            Started by Natoc, Today, 03:04 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by Rudy2323, Today, 02:56 AM
            2 responses
            28 views
            0 likes
            Last Post Rudy2323  
            Started by tonynt, Yesterday, 02:07 PM
            1 response
            38 views
            0 likes
            Last Post NinjaTrader_Jason  
            Working...
            X