RoachStock
New member
Folks,
I have an interesting situation regarding the Horizontal line and am hoping that maybe one of you guys know why this is happening to me.
I've been doing some basic testing with the following codes which the horizontal line was displayed correctly as straight line from left to right on my chart when I set my plBuy to a hard value such as 791.5533 which is the buy price of TSLA that I bought. The plBuy line is displayed as red horizontal line.
I also have a second line which is green and represents 10% profit line as represented by pl1.
I used AddLabel to display my plBuy value which showed up correctly.
Now here is my interesting situation. I changed my plBuy to equals the GetAveragePrice() on 3rd line instead of using plBuy = 791.5533, both my plBuy and pl1 lines are not straight lines but look like this:
Please note that my plBuy was showing same value of 791.5533 as evidenced in the yellow label in top-left corner (see the AddLabel statement).
Any help or explanation you can provide would be greatly appreciated!
I have an interesting situation regarding the Horizontal line and am hoping that maybe one of you guys know why this is happening to me.
I've been doing some basic testing with the following codes which the horizontal line was displayed correctly as straight line from left to right on my chart when I set my plBuy to a hard value such as 791.5533 which is the buy price of TSLA that I bought. The plBuy line is displayed as red horizontal line.
I also have a second line which is green and represents 10% profit line as represented by pl1.
I used AddLabel to display my plBuy value which showed up correctly.
Code:
plot plBuy;
plBuy = 791.5533;
#plBuy = GetAveragePrice();
plot pl1;
plBuy.SetDefaultColor(Color.RED);
plBuy.SetLineWeight(3);
pl1.SetDefaultColor(Color.GREEN);
pl1.SetLineWeight(3);
addLabel(YES,plBuy,color.yellow);
# pl1 is Price Level 10%
pl1 = plBuy * 1.10;

Now here is my interesting situation. I changed my plBuy to equals the GetAveragePrice() on 3rd line instead of using plBuy = 791.5533, both my plBuy and pl1 lines are not straight lines but look like this:

Please note that my plBuy was showing same value of 791.5533 as evidenced in the yellow label in top-left corner (see the AddLabel statement).
Any help or explanation you can provide would be greatly appreciated!