커뮤니티
예스로 변환 부탁드립니다
2013-09-24 01:52:13
148
글번호 67740
Inputs: AvgLength(5), AvgDisplace(5), EntrySetup(4), SetupQ1(3), SetupQ2(5), entryPoint(0.5);
Variables: DMA(0), BuySetup(False), SellSetup(False), BuyPrice(0), SellPrice(0), BuyCount(0), SellCount(0);
DMA = ma(Close, AvgLength)[AvgDisplace];
#Buy Setup
If CrossUp(C, DMA) Then Begin
If MRO( CrossDown(C, DMA), SetupQ2, 1) <> -1 Then
If MRO(CrossUp(C, DMA), 50, 2) – MRO(CrossDown(C, DMA), SetupQ2, 1) <= SetupQ1 Then Begin
BuySetup = True;
BuyPrice = High;
BuyCount = 0;
End;
End;
#Sell Setup
If CrossDown(C, DMA) Then Begin
If MRO(CrossUp(C, DMA), SetupQ2, 1) <> -1 Then
If MRO(CrossDown(C, DMA), 50, 2) – MRO(CrossUp(C, DMA), SetupQ2, 1) <= SetupQ1 Then Begin
SellSetup = True;
SellPrice = Low;
SellCount = 0;
End;
End;
#Long Entry
If BuySetup AND BuyCount <= EntrySetup Then Begin
If MarketPosition == 1 Then
BuySetup = False;
Else Begin
BuyCount = BuyCount + 1;
Buy(“”,atstop, BuyPrice + entryPoint);
End;
End
Else
BuySetup = False;
#Short Entry
If SellSetup AND SellCount <= EntrySetup Then Begin
If MarketPosition == -1 Then
SellSetup = False;
Else Begin
SellCount = SellCount + 1;
Sell(“”,atstop, SellPrice + entryPoint);
End;
End
Else
SellSetup = False;
# DMA Stop
Inputs: DmaLen(20), maDis(15);
Variables: DmaV(0);
DmaV = ma(Close, DmaLen)[maDis];
If MarketPosition <> 0 Then {
ExitLong(“”,atstop,DMA – 1);
ExitShort(“”,atstop,DMA + 1);
}
# Trailing Stop
Inputs: TrailLen(3);
Variables: LowPrice(0), HighPrice(0);
LowPrice = Lowest(Low, TrailLen);
HighPrice = Highest(High, TrailLen);
if MarketPosition <> 0 then {
ExitLong (“EL_Trl”, atstop,LowPrice );
ExitShort (“ES_Trl”, atstop,HighPrice );
}
답변 1
예스스탁 예스스탁 답변
2013-09-24 11:40:14
안녕하세요
예스스탁입니다.
Inputs: AvgLength(5), AvgDisplace(5), EntrySetup(4), SetupQ1(3), SetupQ2(5), entryPoint(0.5);
Variables: DMA(0), BuySetup(False), SellSetup(False), BuyPrice(0), SellPrice(0), BuyCount(0), SellCount(0);
DMA = ma(Close, AvgLength)[AvgDisplace];
#Buy Setup
If CrossUp(C, DMA) Then Begin
If MRO( CrossDown(C, DMA), SetupQ2, 1) <> -1 Then
If MRO(CrossUp(C, DMA), 50, 2) - MRO(CrossDown(C, DMA), SetupQ2, 1) <= SetupQ1 Then Begin
BuySetup = True;
BuyPrice = High;
BuyCount = 0;
End;
End;
#Sell Setup
If CrossDown(C, DMA) Then Begin
If MRO(CrossUp(C, DMA), SetupQ2, 1) <> -1 Then
If MRO(CrossDown(C, DMA), 50, 2) - MRO(CrossUp(C, DMA), SetupQ2, 1) <= SetupQ1 Then Begin
SellSetup = True;
SellPrice = Low;
SellCount = 0;
End;
End;
#Long Entry
If BuySetup AND BuyCount <= EntrySetup Then Begin
If MarketPosition == 1 Then
BuySetup = False;
Else Begin
BuyCount = BuyCount + 1;
Buy("",atstop, BuyPrice + entryPoint);
End;
End
Else
BuySetup = False;
#Short Entry
If SellSetup AND SellCount <= EntrySetup Then Begin
If MarketPosition == -1 Then
SellSetup = False;
Else Begin
SellCount = SellCount + 1;
Sell("",atstop, SellPrice + entryPoint);
End;
End
Else
SellSetup = False;
# DMA Stop
Inputs: DmaLen(20), maDis(15);
Variables: DmaV(0);
DmaV = ma(Close, DmaLen)[maDis];
If MarketPosition <> 0 Then {
ExitLong("",atstop,DMA - 1);
ExitShort("",atstop,DMA + 1);
}
# Trailing Stop
Inputs: TrailLen(3);
Variables: LowPrice(0), HighPrice(0);
LowPrice = Lowest(Low, TrailLen);
HighPrice = Highest(High, TrailLen);
if MarketPosition <> 0 then {
ExitLong ("EL_Trl", atstop,LowPrice );
ExitShort ("ES_Trl", atstop,HighPrice );
}
즐거운 하루되세요
> iamoju 님이 쓴 글입니다.
> 제목 : 예스로 변환 부탁드립니다
> Inputs: AvgLength(5), AvgDisplace(5), EntrySetup(4), SetupQ1(3), SetupQ2(5), entryPoint(0.5);
Variables: DMA(0), BuySetup(False), SellSetup(False), BuyPrice(0), SellPrice(0), BuyCount(0), SellCount(0);
DMA = ma(Close, AvgLength)[AvgDisplace];
#Buy Setup
If CrossUp(C, DMA) Then Begin
If MRO( CrossDown(C, DMA), SetupQ2, 1) <> -1 Then
If MRO(CrossUp(C, DMA), 50, 2) – MRO(CrossDown(C, DMA), SetupQ2, 1) <= SetupQ1 Then Begin
BuySetup = True;
BuyPrice = High;
BuyCount = 0;
End;
End;
#Sell Setup
If CrossDown(C, DMA) Then Begin
If MRO(CrossUp(C, DMA), SetupQ2, 1) <> -1 Then
If MRO(CrossDown(C, DMA), 50, 2) – MRO(CrossUp(C, DMA), SetupQ2, 1) <= SetupQ1 Then Begin
SellSetup = True;
SellPrice = Low;
SellCount = 0;
End;
End;
#Long Entry
If BuySetup AND BuyCount <= EntrySetup Then Begin
If MarketPosition == 1 Then
BuySetup = False;
Else Begin
BuyCount = BuyCount + 1;
Buy(“”,atstop, BuyPrice + entryPoint);
End;
End
Else
BuySetup = False;
#Short Entry
If SellSetup AND SellCount <= EntrySetup Then Begin
If MarketPosition == -1 Then
SellSetup = False;
Else Begin
SellCount = SellCount + 1;
Sell(“”,atstop, SellPrice + entryPoint);
End;
End
Else
SellSetup = False;
# DMA Stop
Inputs: DmaLen(20), maDis(15);
Variables: DmaV(0);
DmaV = ma(Close, DmaLen)[maDis];
If MarketPosition <> 0 Then {
ExitLong(“”,atstop,DMA – 1);
ExitShort(“”,atstop,DMA + 1);
}
# Trailing Stop
Inputs: TrailLen(3);
Variables: LowPrice(0), HighPrice(0);
LowPrice = Lowest(Low, TrailLen);
HighPrice = Highest(High, TrailLen);
if MarketPosition <> 0 then {
ExitLong (“EL_Trl”, atstop,LowPrice );
ExitShort (“ES_Trl”, atstop,HighPrice );
}