Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Assign new value to Lines

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

  • NinjaTrader_AlexG
    replied
    Hello afshinmoshrefi,
    Thanks for writing in today.

    The error you are receiving is because you are assigning the Lines[0] to a double when Lines[0] is a Line object.

    If you would like to set the value you would need to use Lines[0].Value as koganam mentioned.

    Please let us know if we may be of further assistance for anything NinjaTrader.

    Leave a comment:


  • koganam
    replied
    Originally posted by afshinmoshrefi View Post
    I have added lines as follows to my indicator:

    Add(new Line(Color.Purple, 0,"Test"));

    I would like to programmically move the lines.

    I calculate and assign a new value as follows:

    Lines[0] = (double)(lowOfWeek + swing*0.1);

    when I compile I get the following error

    "Cannot implicitly convert type 'double' to 'NinjAtrader.Gui.CharLine'"

    I don't understand this error since Lines[0].Value is a double
    According to what you have posted, you are assigning to Lines[0]. Not quite the same as assigning to Lines[0].Value.

    Leave a comment:


  • afshinmoshrefi
    started a topic Assign new value to Lines

    Assign new value to Lines

    I have added lines as follows to my indicator:

    Add(new Line(Color.Purple, 0,"Test"));

    I would like to programmically move the lines.

    I calculate and assign a new value as follows:

    Lines[0] = (double)(lowOfWeek + swing*0.1);

    when I compile I get the following error

    "Cannot implicitly convert type 'double' to 'NinjAtrader.Gui.CharLine'"

    I don't understand this error since Lines[0].Value is a double

Latest Posts

Collapse

Topics Statistics Last Post
Started by darthy, 08-21-2020, 03:39 PM
2 responses
24 views
0 likes
Last Post darthy
by darthy
 
Started by ballboy11, Today, 09:43 AM
1 response
3 views
0 likes
Last Post NinjaTrader_Jesse  
Started by rene69851, 08-17-2020, 07:30 PM
6 responses
44 views
0 likes
Last Post CactusMo  
Started by ntdev, Today, 04:35 AM
1 response
11 views
0 likes
Last Post NinjaTrader_Jesse  
Started by arangocj, 09-27-2020, 09:46 PM
5 responses
57 views
0 likes
Last Post NinjaTrader_ChristopherD  
Working...
X