커뮤니티
키움 시그널 메이커 수식을 예스로 변환 부탁드립니다.
2018-08-16 08:52:01
321
글번호 121381
시그널메이커에서 사용하는 수식인데 예스로 옮기려고 합니다.
혼자 해보려고 했는데 달라서 많이 힘드네요 변환좀 부탁드립니다. 변환된거 보면서
공부좀 해야겠습니다.
var : IntI(0), intJ(0), intK(0);
var : sngOnetick(1);
var : sngMx(0), sngDt(0);
var : sngPos0(0), sngPos1(0), sngPos2(0);
var : intLN(16);
var : IntCnt(0), LossCutCount(0);
//input : intLoss(10), intLC(3), intTick(4);
var: intLoss(0), intLC(3), intTick(5);
array : sngMLine[50](0);
LossCutCount = 0;
for IntCnt = 0 to 10
Begin
if EntryDate(IntCnt+1) == sdate and PositionProfit(IntCnt+1) < 0 Then
Begin
LossCutCount =LossCutCount + 1;
End;
End;
for IntI = 0 to intLN
Begin
sngMLine[IntI] = sngMx - IntI * sngDt;
End;
for IntI = 1 to intLN
Begin
if (MarketPosition == 0) and (LossCutCount < intLC) then
Begin
If (H[1] < (sngMLine[IntI] - intTick * sngOneTick)) and (H[0] >= sngMLine[IntI] - intTick * sngOneTick) then
Begin
sell("MLine-sell", AtStop, sngMLine[IntI] - intTick * sngOneTick, 1);
sngPos0 = sngMLine[IntI];
sngPos1 = sngMLine[IntI+1];
sngPos2 = sngMLine[IntI-1];
End;
// 매직선 위에 있다가 매직선을 터치하는 경우 매수
If (L[1] > (sngMLine[IntI] + intTick * sngOneTick)) and (L[0] <= sngMLine[IntI] + intTick * sngOneTick) then
Begin
buy("MLine-buy", AtStop, sngMLine[IntI] + intTick * sngOneTick, 1);
sngPos0 = sngMLine[IntI];
sngPos1 = sngMLine[IntI+1];
sngPos2 = sngMLine[IntI-1];
End;
End;
if MarketPosition == 1 then
Begin
if (L[0] <= sngPos0 - intLoss * sngOneTick) Then
Begin
if LossCutCount < intLC then
Begin
sell("SW-Mline-sell", AtStop, sngPos0 - intLoss * sngOneTick, 1);
// if (sdate == 20180222) and (stime >= 101600) and ( stime <= 101700) then {
// messageLog(" sdate : %.0f stime : %.0f H : %.2f i : %.0f sngPos0 : %.2f sngPos1 : %.2f sngPos2 : %.2f", sdate, stime, H, i, sngPos0, sngPos1, sngPos2);
//}
End
else
Begin
ExitLong("Exceed-LosscutCount1");
End;
End;
if (H[0] >= sngPos2 - intTick * sngOneTick) then
Begin
ExitLong("Exit-Mline-buy-100tick");
End;
End;
if MarketPosition == -1 then
Begin
if (H[0] >= sngPos0 + intLoss * sngOneTick) then
Begin
if LossCutCount < intLC then
Begin
buy("SW-Mline-buy", AtStop, sngPos0 + intLoss * sngOneTick, 1);
End
else
Begin
ExitShort("Exceed-LosscutCount-1");
End;
End;
if (L[0] <= sngPos1 + intTick * sngOneTick) then
Begin
ExitShort("Exit-Mline-sell-100tick");
End;
End;
End;
답변 1
예스스탁 예스스탁 답변
2018-08-17 09:27:36
안녕하세요
예스스탁입니다.
올려주신 수식의 내용은 그대로 사용하실 수 있는 내용입니다.
예스랭귀지와 문법이나 함수가 달라 수정을 요하는 부분이 없습니다.
즐거운 하루되세요
> dbs1428 님이 쓴 글입니다.
> 제목 : 키움 시그널 메이커 수식을 예스로 변환 부탁드립니다.
> 시그널메이커에서 사용하는 수식인데 예스로 옮기려고 합니다.
혼자 해보려고 했는데 달라서 많이 힘드네요 변환좀 부탁드립니다. 변환된거 보면서
공부좀 해야겠습니다.
var : IntI(0), intJ(0), intK(0);
var : sngOnetick(1);
var : sngMx(0), sngDt(0);
var : sngPos0(0), sngPos1(0), sngPos2(0);
var : intLN(16);
var : IntCnt(0), LossCutCount(0);
//input : intLoss(10), intLC(3), intTick(4);
var: intLoss(0), intLC(3), intTick(5);
array : sngMLine[50](0);
LossCutCount = 0;
for IntCnt = 0 to 10
Begin
if EntryDate(IntCnt+1) == sdate and PositionProfit(IntCnt+1) < 0 Then
Begin
LossCutCount =LossCutCount + 1;
End;
End;
for IntI = 0 to intLN
Begin
sngMLine[IntI] = sngMx - IntI * sngDt;
End;
for IntI = 1 to intLN
Begin
if (MarketPosition == 0) and (LossCutCount < intLC) then
Begin
If (H[1] < (sngMLine[IntI] - intTick * sngOneTick)) and (H[0] >= sngMLine[IntI] - intTick * sngOneTick) then
Begin
sell("MLine-sell", AtStop, sngMLine[IntI] - intTick * sngOneTick, 1);
sngPos0 = sngMLine[IntI];
sngPos1 = sngMLine[IntI+1];
sngPos2 = sngMLine[IntI-1];
End;
// 매직선 위에 있다가 매직선을 터치하는 경우 매수
If (L[1] > (sngMLine[IntI] + intTick * sngOneTick)) and (L[0] <= sngMLine[IntI] + intTick * sngOneTick) then
Begin
buy("MLine-buy", AtStop, sngMLine[IntI] + intTick * sngOneTick, 1);
sngPos0 = sngMLine[IntI];
sngPos1 = sngMLine[IntI+1];
sngPos2 = sngMLine[IntI-1];
End;
End;
if MarketPosition == 1 then
Begin
if (L[0] <= sngPos0 - intLoss * sngOneTick) Then
Begin
if LossCutCount < intLC then
Begin
sell("SW-Mline-sell", AtStop, sngPos0 - intLoss * sngOneTick, 1);
// if (sdate == 20180222) and (stime >= 101600) and ( stime <= 101700) then {
// messageLog(" sdate : %.0f stime : %.0f H : %.2f i : %.0f sngPos0 : %.2f sngPos1 : %.2f sngPos2 : %.2f", sdate, stime, H, i, sngPos0, sngPos1, sngPos2);
//}
End
else
Begin
ExitLong("Exceed-LosscutCount1");
End;
End;
if (H[0] >= sngPos2 - intTick * sngOneTick) then
Begin
ExitLong("Exit-Mline-buy-100tick");
End;
End;
if MarketPosition == -1 then
Begin
if (H[0] >= sngPos0 + intLoss * sngOneTick) then
Begin
if LossCutCount < intLC then
Begin
buy("SW-Mline-buy", AtStop, sngPos0 + intLoss * sngOneTick, 1);
End
else
Begin
ExitShort("Exceed-LosscutCount-1");
End;
End;
if (L[0] <= sngPos1 + intTick * sngOneTick) then
Begin
ExitShort("Exit-Mline-sell-100tick");
End;
End;
End;