-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathEntryBar__Stop_LX.Strategy.CS
More file actions
36 lines (29 loc) · 966 Bytes
/
EntryBar__Stop_LX.Strategy.CS
File metadata and controls
36 lines (29 loc) · 966 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
namespace PowerLanguage.Strategy
{
[IOGMode(IOGMode.Disabled)]
public class EntryBar__Stop_LX : SignalObject
{
private double m_BigPointRisk;
private IOrderPriced m_EbDlrSX;
public EntryBar__Stop_LX(object ctx) :
base(ctx)
{
DollarRisk = 1;
}
[Input]
public double DollarRisk { get; set; }
protected override void Create(){
m_EbDlrSX =
OrderCreator.Stop(new SOrderParameters(Contracts.Default, "EbDlrSX", EOrderAction.BuyToCover,
OrderExit.FromAll));
}
protected override void StartCalc(){
m_BigPointRisk = DollarRisk/Bars.Info.BigPointValue;
}
protected override void CalcBar(){
if (StrategyInfo.MarketPosition >= 0){
m_EbDlrSX.Send(Bars.Close[0] + m_BigPointRisk);
}
}
}
}