-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathChannel_Breakout_LE.Strategy.CS
More file actions
40 lines (31 loc) · 1002 Bytes
/
Channel_Breakout_LE.Strategy.CS
File metadata and controls
40 lines (31 loc) · 1002 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
40
using System;
using PowerLanguage.Function;
namespace PowerLanguage.Strategy
{
[IOGMode(IOGMode.Disabled)]
public class Channel_Breakout_LE : SignalObject
{
private HighestFC m_HighestFC; //HH
private IOrderPriced m_ChBrkLE;
public Channel_Breakout_LE(object ctx) :
base(ctx)
{
Length = 20;
}
private ISeries<double> Price { get; set; }
[Input]
public int Length { get; set; }
protected override void Create(){
m_HighestFC = new HighestFC(this);
m_ChBrkLE = OrderCreator.Stop(new SOrderParameters(Contracts.Default, "ChBrkLE", EOrderAction.Buy));
}
protected override void StartCalc(){
Price = Bars.High;
m_HighestFC.pricevalue = Price; //HH(H,N)
m_HighestFC.len = Length;
}
protected override void CalcBar(){
m_ChBrkLE.Send(m_HighestFC[0] + Bars.Point); //HH+1
}
}
}