Here is few line of code to print a string, at a defined price a string. For the purpose of this post, I included the string and the price position As an input value.
For me I will use the code to create horizontal trendline to display few key point on the chart.
Code: Select all
//aiLeftDispDateTime
Input:
InputPrice (1.2800),
TextToPrint ("This is a test");
Var:
DateTimeFirstBar (0),
sdate (0),
sTime (0),
sPrice (0),
Left.Date (0),
left.time(0),
TextH1 (0);
DateTimeFirstBar = getappinfo(aiLeftDispDateTime);
If barstatus[1] = 2 then begin
Value1 = text_delete(TextH1);
left.date = juliantodate( getappinfo( aileftdispdatetime ) );
Left.time = (datetime2eltime_s(getappinfo( aileftdispdatetime )) );
Print (Left.Date, " ", left.time);
TextH1= Text_New_S(Left.date,Left.time,InputPrice, " TextToPrint");
Value2 = text_setstyle(TextH1,0,1);
Value2 = Text_SetColor(TextH1,Red);
end;