|
QuantShare
2011-04-29 08:33:50
0
|
|
Here is the horizontal line script: (Tools -> Custom Drawing Tools)
double y = Functions.CursorPosition.Y;
y = Math.Round(y, 3);
double x = Functions.CursorPosition.X;
if(Functions.ClickPositions.Length > 0)
{
y = Functions.ClickPositions[0].Y;
y = Math.Round(y, 3);
x = Functions.ClickPositions[0].X;
Functions.SetSettings("Price", y);
Functions.SettingChanged = change;
Functions.FinishDrawing();
}
Functions.PaneObject.DrawLine("line1", x, y, Functions.ChartData.EndIndex, y);
TextObj text = Functions.PaneObject.DrawText("text1", y.ToString(), x, y);
text.Location.VerticalAlignment = "bottom";
#functions#
void change(object sender, SettingEventArgs e)
{
if(e.Name == "Price")
{
Functions.ClickPositions[0].Y = (double)e.Value;
}
}
----------------
Add one setting: Input - Price - Numeric
Right click on the bookmark panel to add a shortcut for this drawing item
|
|