예스스탁
예스스탁 답변
2020-05-06 10:39:35
안녕하세요
예스스탁입니다.
Input : 손절(4),익절(5),익절하락(1);
input : P1(30), P2(200), p3(230), P4(260), P5(320);
input : StartTime(090300),EndTime(151500);
var : tx(0),X(false),Tcond(false),tt(0),vol(1);
var1 = ma(C, P1);
var2 = ma(C, P2);
var3 = ma(C, P3);
var4 = ma(C, P4);
var5 = ma(C, P5);
######## 진입제한
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime)Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= Endtime) or
(sdate == sdate[1] and stime >= Endtime and stime[1] < Endtime)Then
{
Tcond = false;
}
## 진입
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "B1",BarsSinceEntry) < 1)) and
crossup(var1,var2) Then
{
buy("B1");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "S1",BarsSinceEntry) < 1)) and
crossdown(var1,var2) Then
{
sell("S1");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "B2",BarsSinceEntry) < 1)) and
crossup(var2,var3) and var3[1] < var3 Then
{
buy("B2");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "S2",BarsSinceEntry) < 1)) and
crossdown(var3,var4) and var3[1] > var3 Then
{
sell("S2");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "B4",BarsSinceEntry) < 1)) and
crossup(var1,var4) Then
{
buy("B4");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "S4",BarsSinceEntry) < 1)) and
crossdown(var1,var4) Then
{
sell("S4");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "B5",BarsSinceEntry) < 1)) and
crossup(var2,var5) and var3[1] < var3 Then
{
buy("B5");
}
if Tcond == true and (marketposition <= 0 or (MarketPosition == 1 and countif(LatestEntryName(0) == "S5",BarsSinceEntry) < 1)) and
crossdown(var3,var5) and var3[1] > var3 Then
{
sell("S5");
}
#### Target 청산
if MarketPosition == 1 then {
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if Marketposition == -1 Then {
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if ((sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime)) Then {
if MarketPosition == 1 Then
ExitLong("BE6");
if MarketPosition == -1 Then
ExitShort("SE6");
}
즐거운 하루되세요
> 라떼처럼 님이 쓴 글입니다.
> 제목 : 부탁드립니다
> 항상 감사드립니다
아래식을 피라미딩 적용하려합니다.
피라미딩 중 각각의 진입명이 한번이상 들어가지 않도록 부탁드립니다
Input : 손절(4),익절(5),익절하락(1);
input : P1(30), P2(200), p3(230), P4(260), P5(320);
input : StartTime(090300),EndTime(151500);
var : tx(0),X(false),Tcond(false),tt(0),vol(1);
var1 = ma(C, P1);
var2 = ma(C, P2);
var3 = ma(C, P3);
var4 = ma(C, P4);
var5 = ma(C, P5);
######## 진입제한
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime)Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= Endtime) or
(sdate == sdate[1] and stime >= Endtime and stime[1] < Endtime)Then
{
Tcond = false;
}
## 진입
if Tcond == true and marketposition == 0
and crossup(var1,var2) Then
{
buy("B1");
}
if Tcond == true and marketposition == 0
and crossdown(var1,var2) Then
{
sell("S1");
}
if Tcond == true and marketposition == 0
and crossup(var2,var3) and var3[1] < var3 Then
{
buy("B2");
}
if Tcond == true and marketposition == 0
and crossdown(var3,var4) and var3[1] > var3 Then
{
sell("S2");
}
if Tcond == true and marketposition == 0
and crossup(var1,var4) Then
{
buy("B4");
}
if Tcond == true and marketposition == 0
and crossdown(var1,var4) Then
{
sell("S4");
}
if Tcond == true and marketposition == 0
and crossup(var2,var5) and var3[1] < var3 Then
{
buy("B5");
}
if Tcond == true and marketposition == 0
and crossdown(var3,var5) and var3[1] > var3 Then
{
sell("S5");
}
#### Target 청산
if MarketPosition == 1 then {
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if Marketposition == -1 Then {
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if ((sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime)) Then {
if MarketPosition == 1 Then
ExitLong("BE6");
if MarketPosition == -1 Then
ExitShort("SE6");
}