커뮤니티
추가 서식 부탁드립니다.
2016-08-24 20:04:47
113
글번호 101324
{ 추가질문 }
당일 매매 시간중 매매종료시간전(22시)에 누계 수익틱이 매매횟수 차감하고
30틱 수익이 나는 시점에 그날 시스템 매매는 종료하는 수식도 추가 부탁드립니다.
input:b_time1(080000),e_time1(220000),
stoK_p11(150),stoK_p12(50),stoK_p13(10),
ma_p11(25),ma_p12(5),ma_p13(15),ma_p14(100),
ma_p15(10),ma_p16(20),ma_p17(15),상단(90),하단(10),익절틱수(10);
Var:stoK(0),stoD(0),TRIXv(0),TRIXsig(0),T(0);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK = StochasticsKs(stoK_p11,stoK_p12);
stoD = StochasticsDs(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1
Then
{
T = 1;
}
If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1
Then
{
T = -1;
}
if T == 1 and CrossDown(stok,하단) Then
buy("매수",AtMarket);
if MarketPosition == 1 Then
{
if crossup(stok,상단) and c >= EntryPrice Then
exitlong("매수청산1",AtMarket);
if crossup(stok,상단) and c <= EntryPrice Then
exitlong("매수청산2",atlimit,EntryPrice+PriceScale*2);
if T == -1 Then
exitlong("추세전환(-)",AtMarket);
}
if T == -1 and Crossup(stok,상단) Then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossdown(stok,하단) and C <= EntryPrice Then
ExitShort("매도청산1",AtMarket);
if Crossdown(stok,하단) and C > EntryPrice Then
ExitShort("매도청산2",Atlimit,EntryPrice-PriceScale*2);
if T == 1 Then
exitShort("추세전환(+)",AtMarket);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
답변 1
예스스탁 예스스탁 답변
2016-08-25 11:07:02
안녕하세요
예스스탁입니다.
input:b_time1(080000),e_time1(220000),
stoK_p11(150),stoK_p12(50),stoK_p13(10),
ma_p11(25),ma_p12(5),ma_p13(15),ma_p14(100),
ma_p15(10),ma_p16(20),ma_p17(15),상단(90),하단(10),익절틱수(10);
Var:stoK(0),stoD(0),TRIXv(0),TRIXsig(0),T(0);
input : 하루수익틱수(30);
var : NP(0),PreNP(0),DayPL(0),하루수익(0),Xcond(false);
하루수익 = PriceScale*하루수익틱수;
NP = NetProfit;
if stime == b_time1 or (stime > b_time1 and stime[1] < b_time1) Then{
preNP = NP[1];
Xcond = false;
}
daypl = NP-PreNP;
If b_time1 <= Time and Time <= e_time1 Then
{
stoK = StochasticsKs(stoK_p11,stoK_p12);
stoD = StochasticsDs(stoK_p11,stoK_p12,stoK_p13);
if TotalTrades > TotalTrades[1] and (IsExitName("bx",1) == true or IsExitName("sx",1) == true) Then
Xcond = true;
If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1
Then
{
T = 1;
}
If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1
Then
{
T = -1;
}
if T == 1 and CrossDown(stok,하단) and Xcond == false Then
buy("매수",AtMarket);
if MarketPosition == 1 Then
{
if crossup(stok,상단) and c >= EntryPrice Then
exitlong("매수청산1",AtMarket);
if crossup(stok,상단) and c <= EntryPrice Then
exitlong("매수청산2",atlimit,EntryPrice+PriceScale*2);
if T == -1 Then
exitlong("추세전환(-)",AtMarket);
if MarketPosition == 1 Then
ExitLong("bx",AtStop,EntryPrice+하루수익-dayPL);
}
if T == -1 and Crossup(stok,상단) and Xcond == false Then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossdown(stok,하단) and C <= EntryPrice Then
ExitShort("매도청산1",AtMarket);
if Crossdown(stok,하단) and C > EntryPrice Then
ExitShort("매도청산2",Atlimit,EntryPrice-PriceScale*2);
if T == 1 Then
exitShort("추세전환(+)",AtMarket);
if MarketPosition == -1 Then
ExitShort("sx",AtStop,EntryPrice-하루수익+daypl);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : 추가 서식 부탁드립니다.
> { 추가질문 }
당일 매매 시간중 매매종료시간전(22시)에 누계 수익틱이 매매횟수 차감하고
30틱 수익이 나는 시점에 그날 시스템 매매는 종료하는 수식도 추가 부탁드립니다.
input:b_time1(080000),e_time1(220000),
stoK_p11(150),stoK_p12(50),stoK_p13(10),
ma_p11(25),ma_p12(5),ma_p13(15),ma_p14(100),
ma_p15(10),ma_p16(20),ma_p17(15),상단(90),하단(10),익절틱수(10);
Var:stoK(0),stoD(0),TRIXv(0),TRIXsig(0),T(0);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK = StochasticsKs(stoK_p11,stoK_p12);
stoD = StochasticsDs(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_p11)[1] < ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] <= ma(C,ma_p13)[1] and ma(C,ma_p12) > ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] < ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] < ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] < ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] < ma(C,ma_p17),1) == 1
Then
{
T = 1;
}
If countif(ma(C,ma_p11)[1] > ma(C,ma_p11),1) == 1
and (ma(C,ma_p12)[1] >= ma(C,ma_p13)[1] and ma(C,ma_p12) < ma(C,ma_p13))
and countif(ma(C,ma_p14)[1] > ma(C,ma_p14),1) == 1
and countif(ma(C,ma_p15)[1] > ma(C,ma_p15),1) == 1
and countif(ma(C,ma_p16)[1] > ma(C,ma_p16),1) == 1
and countif(ma(C,ma_p17)[1] > ma(C,ma_p17),1) == 1
Then
{
T = -1;
}
if T == 1 and CrossDown(stok,하단) Then
buy("매수",AtMarket);
if MarketPosition == 1 Then
{
if crossup(stok,상단) and c >= EntryPrice Then
exitlong("매수청산1",AtMarket);
if crossup(stok,상단) and c <= EntryPrice Then
exitlong("매수청산2",atlimit,EntryPrice+PriceScale*2);
if T == -1 Then
exitlong("추세전환(-)",AtMarket);
}
if T == -1 and Crossup(stok,상단) Then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossdown(stok,하단) and C <= EntryPrice Then
ExitShort("매도청산1",AtMarket);
if Crossdown(stok,하단) and C > EntryPrice Then
ExitShort("매도청산2",Atlimit,EntryPrice-PriceScale*2);
if T == 1 Then
exitShort("추세전환(+)",AtMarket);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
다음글
이전글