-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathFloating_Text.Indicator.CS
More file actions
39 lines (33 loc) · 987 Bytes
/
Floating_Text.Indicator.CS
File metadata and controls
39 lines (33 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using PowerLanguage.Function;
namespace PowerLanguage.Indicator
{
[SameAsSymbol(true)]
[RecoverDrawings(false)]
public class Floating_Text : IndicatorObject
{
private ITextObject m_text_obj;
public Floating_Text(object ctx) :
base(ctx){
textpricepercent = 50;
textbarsback = 10;
texttoplot = "MyText";
}
[Input]
public string texttoplot { get; set; }
[Input]
public int textbarsback { get; set; }
[Input]
public double textpricepercent { get; set; }
protected override void CalcBar(){
if (!Bars.LastBarOnChart) return;
if (m_text_obj == null)
{
m_text_obj = DrwText.Create(new ChartPoint(Bars.Time[0], Bars.Close[0]), texttoplot);
}
else{
this.Text_Float(m_text_obj, textbarsback, textpricepercent);
}
}
}
}