forked from zonquan/TradeStation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsfgf.plotentrytargets.txt
95 lines (85 loc) · 2.67 KB
/
sfgf.plotentrytargets.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
[LegacyColorValue = true];
{
Function : sfgf.plotentrytargets
Description : Plot the entry points, both stops and limits
Copyright 2016 Scottfree Gains LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
}
Inputs:
SystemID(String),
BuyStop(Numeric),
BuyLimit(Numeric),
ShortStop(Numeric),
ShortLimit(Numeric);
Variables:
PlotColor(Black),
BSLine(-1),
BLLine(-1),
SSLine(-1),
SLLine(-1),
BSString(""),
BLString(""),
SSString(""),
SLString(""),
BSText(-1),
BLText(-1),
SSText(-1),
SLText(-1);
sfgf.plotentrytargets = False;
If LastBarOnChart Then Begin
If GetBackGroundColor = 1 Then
PlotColor = White;
If BuyStop > 0 Then Begin
BSString = " LE " + SystemID + " Stop ";
BSLine = TL_New(Date[0], Time[0], BuyStop, Date[1], Time[1], BuyStop);
If BSLine >= 0 Then Begin
TL_SetColor(BSLine, PlotColor);
TL_SetSize(BSLine, 1);
TL_SetExtRight(BSLine, True);
BSText = Text_New(Date, Time, BuyStop, BSString);
Text_SetColor(BSText, PlotColor);
End;
End;
If BuyLimit > 0 Then Begin
BLString = " LE " + SystemID + " Limit ";
BLLine = TL_New(Date[0], Time[0], BuyLimit, Date[1], Time[1], BuyLimit);
If BLLine >= 0 Then Begin
TL_SetColor(BLLine, PlotColor);
TL_SetSize(BLLine, 1);
TL_SetExtRight(BLLine, True);
BLText = Text_New(Date, Time, BuyLimit, BLString);
Text_SetColor(BLText, PlotColor);
End;
End;
If ShortStop > 0 Then Begin
SSString = " SE " + SystemID + " Stop ";
SSLine = TL_New(Date[0], Time[0], ShortStop, Date[1], Time[1], ShortStop);
If SSLine >= 0 Then Begin
TL_SetColor(SSLine, PlotColor);
TL_SetSize(SSLine, 1);
TL_SetExtRight(SSLine, True);
SSText = Text_New(Date, Time, ShortStop, SSString);
Text_SetColor(SSText, PlotColor);
End;
End;
If ShortLimit > 0 Then Begin
SLString = " SE " + SystemID + " Limit ";
SLLine = TL_New(Date[0], Time[0], ShortLimit, Date[1], Time[1], ShortLimit);
If SLLine >= 0 Then Begin
TL_SetColor(SLLine, PlotColor);
TL_SetSize(SLLine, 1);
TL_SetExtRight(SLLine, True);
SLText = Text_New(Date, Time, ShortLimit, SLString);
Text_SetColor(SLText, PlotColor);
End;
End;
End;
sfgf.plotentrytargets = True;