Problem date and time....draw trendline

Questions about MultiCharts .NET and user contributed studies.
turbofib
Posts: 162
Joined: 11 May 2013
Has thanked: 48 times
Been thanked: 1 time

Problem date and time....draw trendline

Postby turbofib » 30 Jul 2014

to bo patient with the new beginners mc.net :(

i see example in forum and in the guide mc.net

Code: Select all

protected override void CalcBar()
{
if (Bars.CurrentBar == 1)
{
ChartPoint top = new ChartPoint(Bars.TimeValue, Bars.HighValue);
ChartPoint bottom = new ChartPoint(Bars.TimeValue, Bars.LowValue);

DrwTrendLine.Create(bottom, top);
DrwArrow.Create(bottom, false);
ITextObject textObj = DrwText.Create(top, "1");
textObj.VStyle = ETextStyleV.Above;
}
}
but I did not understand how to apply it knowing only the variable datatime

DateTime datetimelow;

DateTime datetimehigh;


I can not replicate the draw of the trendline...



Here declare 2 variables type DateTime(datetimelow and datetimehigh)

DateTime datetimelow;

DateTime datetimehigh;


if bars.high = 444 (is an example) ====> i want assigned value time and date to variable datetimehigh

if bars.low = 400 (is an example) ====> i want assigned value time and date to variable datetimelow

but i don't understand how can i do it..

someone help me?

User avatar
JoshM
Posts: 2099
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1526 times
Been thanked: 1502 times
Contact:

Re: Problem date and time....draw trendline

Postby JoshM » 30 Jul 2014

if bars.low = 400 (is an example) ====> i want assigned value time and date to variable datetimelow
You mean like this?

Code: Select all

private DateTime timeOfLow;

protected override void CalcBar()
{
if (Bars.Low[0] == 400)
{
timeOfLow = Bars.Time[0];
}
}


Return to “MultiCharts .NET”