Click here to Login





                                                   DrawLine question

  0

0
Obuli Govindaraju
2011-12-25 22:10:59


So a PaneObject.DrawLine function draws a line from start co-ordinate to end co-ordinate.

The x-axis of this co-ordinate is bar index and y co-ordinate is the price correct?

Now when I execute this script below I expect to see a line from (startIndex,close[startIndex]) to (endIndex,close[endIndex]) but it is not working.
The script is drawing a line from endIndex-1 to endIndex and beyond. What am I doing wrong?

Here is the script.

Chart chart = Charts.GetSelectedChart();
PaneObject pane = chart.Panes[0].CreatePaneObject("Pane");

int endIndex = chart.ChartData.EndIndex;
int startIndex = chart.ChartData.StartIndex;
double startValue = chart.ChartData.GetTimeSeries("close")[startIndex];
double endValue = chart.ChartData.GetTimeSeries("close")[endIndex];

LineObj line = pane.DrawLine("Lines",startIndex,startValue,endIndex,endValue);
line.Line.Color = Color.BlueViolet;

pane.Update();



QuantShare
2011-12-26 06:19:25

  0

Best Answer
Thank you for reporting this. A small issue was preventing the line from being drawn correctly. It will be fixed in the next release.


No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Camarilla Pivot Points Study
Updating Margin Factor During Drawdown
Structural Arbitrage Strategy
Forex Daily Volatility
Number of Stocks Making a new 52-Week High - Market Indicator

How-to Lessons
How to automatically arrange charts?
How to calculate the average of a time series using the money man...
How to create a moving average of an indicator
How to plot the relative performance of several stocks/indices
How to import trades into a portfolio

Related Forum Threads
Question about an object
Simulator Question
Question on Swing Point function sp()
Money management script question
"Combine Trading Systems" tool Question

Blog Posts
Reducing risk and increasing return by combining several trading ...
Diversify your portfolio by investing in stocks from various indu...
3 ways to rank stocks in a trading system - Simulator and Potfoli...
Stock Market Prediction with QuantShare
Programming skills are not that important









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.