커뮤니티
수식 부탁드립니다.
2018-12-10 14:50:52
178
글번호 124305
아래와 같이 수식을 매도로만 적용시에 매도 진입 후 시스템 설정에서 강제청산 설정
손절매를 기준으로 손절매 된 후 다음 매도진입 조건에서 진입이 1~3회씩 사용자 조건식(input)으로 진입이 안되고 다음회차에서 진입이 되도록 수식 변경 부탁드립니다.
추가로 익절틱수로 하루에 input 기준으로 몇틱이상 수익이 나면 진입이 되지않도록 수식도 부탁드립니다.
Var:stoK(0),stoD(0),T1(0),T2(0);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If b_time1<=Time and Time<= e_time1 Then
{
stoK = StochasticsK(stoK_p11,stoK_p12);
stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_Period11)[1] < ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] <= ma(C,ma_Period13)[1] and ma(C,ma_Period12) > ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] < ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] < ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] < ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] < ma(C,ma_Period17),1) == 1
Then
{
T1 = 1;
}
If countif(ma(C,ma_Period11)[1] > ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] >= ma(C,ma_Period13)[1] and ma(C,ma_Period12) < ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] > ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] > ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] > ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] > ma(C,ma_Period17),1) == 1
Then
{
T1 = -1;
}
If countif(ma(C,ma_Period21)[1] < ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] <= ma(C,ma_Period23)[1] and ma(C,ma_Period22) > ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] < ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] < ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] < ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] < ma(C,ma_Period27),1) == 1
Then
{
T2 = 2;
}
If countif(ma(C,ma_Period21)[1] > ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] >= ma(C,ma_Period23)[1] and ma(C,ma_Period22) < ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] > ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] > ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] > ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] > ma(C,ma_Period27),1) == 1
Then
{
T2 = -2;
}
}
if MarketPosition == 0 and T1 == -1 and T2 == -2 and Crossup(stok,상단) and MarketPosition >= 0 then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossup(value1, value2) then
ExitShort("매도청산",AtMarket);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
답변 4
예스스탁 예스스탁 답변
2018-12-10 15:37:17
안녕하세요
예스스탁입니다.
해당수식 내용은 기존 포지션함수를 배제하고
가상으로 거래를 체크하는 내용도 추가해야 하는등
작성해 보는데 시간이 많이 걸리는 내용으로 저희가 답변드리기 어렵습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 아래와 같이 수식을 매도로만 적용시에 매도 진입 후 시스템 설정에서 강제청산 설정
손절매를 기준으로 손절매 된 후 다음 매도진입 조건에서 진입이 1~3회씩 사용자 조건식(input)으로 진입이 안되고 다음회차에서 진입이 되도록 수식 변경 부탁드립니다.
추가로 익절틱수로 하루에 input 기준으로 몇틱이상 수익이 나면 진입이 되지않도록 수식도 부탁드립니다.
Var:stoK(0),stoD(0),T1(0),T2(0);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If b_time1<=Time and Time<= e_time1 Then
{
stoK = StochasticsK(stoK_p11,stoK_p12);
stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_Period11)[1] < ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] <= ma(C,ma_Period13)[1] and ma(C,ma_Period12) > ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] < ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] < ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] < ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] < ma(C,ma_Period17),1) == 1
Then
{
T1 = 1;
}
If countif(ma(C,ma_Period11)[1] > ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] >= ma(C,ma_Period13)[1] and ma(C,ma_Period12) < ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] > ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] > ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] > ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] > ma(C,ma_Period17),1) == 1
Then
{
T1 = -1;
}
If countif(ma(C,ma_Period21)[1] < ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] <= ma(C,ma_Period23)[1] and ma(C,ma_Period22) > ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] < ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] < ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] < ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] < ma(C,ma_Period27),1) == 1
Then
{
T2 = 2;
}
If countif(ma(C,ma_Period21)[1] > ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] >= ma(C,ma_Period23)[1] and ma(C,ma_Period22) < ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] > ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] > ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] > ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] > ma(C,ma_Period27),1) == 1
Then
{
T2 = -2;
}
}
if MarketPosition == 0 and T1 == -1 and T2 == -2 and Crossup(stok,상단) and MarketPosition >= 0 then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossup(value1, value2) then
ExitShort("매도청산",AtMarket);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
미완
2018-12-10 15:52:00
답변 감사드립니다. 그러면 아래 내용을 추가하여
익절틱수로 하루에 input 기준으로 몇틱이상 수익이 나면 진입이 되지않도록 수식도 불가능한지요?
input: b_time1(000000),e_time1(240000);
Input : shortPeriod(500), longPeriod(500);
input: stoK_p11(200),stoK_p12(6),stoK_p13(6),
ma_period11(30),ma_period12(5),ma_period13(10),ma_period14(90),
ma_period15(10),ma_period16(10),ma_period17(15);
input: ma_period21(25),ma_period22(13),ma_period23(3),ma_period24(100),
ma_period25(10),ma_period26(20),ma_period27(15),상단(98),하단(2),익절틱수(15);
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 부탁드립니다.
> 안녕하세요
예스스탁입니다.
해당수식 내용은 기존 포지션함수를 배제하고
가상으로 거래를 체크하는 내용도 추가해야 하는등
작성해 보는데 시간이 많이 걸리는 내용으로 저희가 답변드리기 어렵습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 아래와 같이 수식을 매도로만 적용시에 매도 진입 후 시스템 설정에서 강제청산 설정
손절매를 기준으로 손절매 된 후 다음 매도진입 조건에서 진입이 1~3회씩 사용자 조건식(input)으로 진입이 안되고 다음회차에서 진입이 되도록 수식 변경 부탁드립니다.
추가로 익절틱수로 하루에 input 기준으로 몇틱이상 수익이 나면 진입이 되지않도록 수식도 부탁드립니다.
Var:stoK(0),stoD(0),T1(0),T2(0);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If b_time1<=Time and Time<= e_time1 Then
{
stoK = StochasticsK(stoK_p11,stoK_p12);
stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_Period11)[1] < ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] <= ma(C,ma_Period13)[1] and ma(C,ma_Period12) > ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] < ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] < ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] < ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] < ma(C,ma_Period17),1) == 1
Then
{
T1 = 1;
}
If countif(ma(C,ma_Period11)[1] > ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] >= ma(C,ma_Period13)[1] and ma(C,ma_Period12) < ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] > ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] > ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] > ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] > ma(C,ma_Period17),1) == 1
Then
{
T1 = -1;
}
If countif(ma(C,ma_Period21)[1] < ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] <= ma(C,ma_Period23)[1] and ma(C,ma_Period22) > ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] < ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] < ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] < ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] < ma(C,ma_Period27),1) == 1
Then
{
T2 = 2;
}
If countif(ma(C,ma_Period21)[1] > ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] >= ma(C,ma_Period23)[1] and ma(C,ma_Period22) < ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] > ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] > ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] > ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] > ma(C,ma_Period27),1) == 1
Then
{
T2 = -2;
}
}
if MarketPosition == 0 and T1 == -1 and T2 == -2 and Crossup(stok,상단) and MarketPosition >= 0 then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossup(value1, value2) then
ExitShort("매도청산",AtMarket);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
예스스탁 예스스탁 답변
2018-12-10 18:03:45
안녕하세요
예스스탁입니다.
기존수식에 해당 내용은 가능합니다.
b_time1시간을 기준으로 당일 수익을 체크하게 작성했습니다.
input: b_time1(000000),e_time1(240000);
Input : shortPeriod(500), longPeriod(500);
input: stoK_p11(200),stoK_p12(6),stoK_p13(6),
ma_period11(30),ma_period12(5),ma_period13(10),ma_period14(90),
ma_period15(10),ma_period16(10),ma_period17(15);
input: ma_period21(25),ma_period22(13),ma_period23(3),ma_period24(100),
ma_period25(10),ma_period26(20),ma_period27(15),상단(98),하단(2),익절틱수(15);
Input : 당일수익틱수(80);
Var:stoK(0),stoD(0),T1(0),T2(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
if (sdate != sdate[1] and stime >= b_time1) or
(sdate == sdate[1] and stime >= b_time1 and stime[1] < b_time1) Then
{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] Then
{
if IsExitName("dsp",1) == true then
Xcond = true;
if daypl >= 당일수익 Then
Xcond = true;
}
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If b_time1<=sTime and sTime<= e_time1 Then
{
stoK = StochasticsK(stoK_p11,stoK_p12);
stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_Period11)[1] < ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] <= ma(C,ma_Period13)[1] and ma(C,ma_Period12) > ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] < ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] < ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] < ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] < ma(C,ma_Period17),1) == 1
Then
{
T1 = 1;
}
If countif(ma(C,ma_Period11)[1] > ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] >= ma(C,ma_Period13)[1] and ma(C,ma_Period12) < ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] > ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] > ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] > ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] > ma(C,ma_Period17),1) == 1
Then
{
T1 = -1;
}
If countif(ma(C,ma_Period21)[1] < ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] <= ma(C,ma_Period23)[1] and ma(C,ma_Period22) > ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] < ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] < ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] < ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] < ma(C,ma_Period27),1) == 1
Then
{
T2 = 2;
}
If countif(ma(C,ma_Period21)[1] > ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] >= ma(C,ma_Period23)[1] and ma(C,ma_Period22) < ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] > ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] > ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] > ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] > ma(C,ma_Period27),1) == 1
Then
{
T2 = -2;
}
}
if Xcond == false and
MarketPosition == 0 and
T1 == -1 and T2 == -2 and
Crossup(stok,상단) and
MarketPosition >= 0 then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if Crossup(value1, value2) then
ExitShort("매도청산",AtMarket);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : Re : Re : 수식 부탁드립니다.
> 답변 감사드립니다. 그러면 아래 내용을 추가하여
익절틱수로 하루에 input 기준으로 몇틱이상 수익이 나면 진입이 되지않도록 수식도 불가능한지요?
input: b_time1(000000),e_time1(240000);
Input : shortPeriod(500), longPeriod(500);
input: stoK_p11(200),stoK_p12(6),stoK_p13(6),
ma_period11(30),ma_period12(5),ma_period13(10),ma_period14(90),
ma_period15(10),ma_period16(10),ma_period17(15);
input: ma_period21(25),ma_period22(13),ma_period23(3),ma_period24(100),
ma_period25(10),ma_period26(20),ma_period27(15),상단(98),하단(2),익절틱수(15);
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 부탁드립니다.
> 안녕하세요
예스스탁입니다.
해당수식 내용은 기존 포지션함수를 배제하고
가상으로 거래를 체크하는 내용도 추가해야 하는등
작성해 보는데 시간이 많이 걸리는 내용으로 저희가 답변드리기 어렵습니다.
도움을 드리지 못해 죄송합니다.
즐거운 하루되세요
> 미완 님이 쓴 글입니다.
> 제목 : 수식 부탁드립니다.
> 아래와 같이 수식을 매도로만 적용시에 매도 진입 후 시스템 설정에서 강제청산 설정
손절매를 기준으로 손절매 된 후 다음 매도진입 조건에서 진입이 1~3회씩 사용자 조건식(input)으로 진입이 안되고 다음회차에서 진입이 되도록 수식 변경 부탁드립니다.
추가로 익절틱수로 하루에 input 기준으로 몇틱이상 수익이 나면 진입이 되지않도록 수식도 부탁드립니다.
Var:stoK(0),stoD(0),T1(0),T2(0);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
If b_time1<=Time and Time<= e_time1 Then
{
stoK = StochasticsK(stoK_p11,stoK_p12);
stoD = StochasticsD(stoK_p11,stoK_p12,stoK_p13);
If countif(ma(C,ma_Period11)[1] < ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] <= ma(C,ma_Period13)[1] and ma(C,ma_Period12) > ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] < ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] < ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] < ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] < ma(C,ma_Period17),1) == 1
Then
{
T1 = 1;
}
If countif(ma(C,ma_Period11)[1] > ma(C,ma_Period11),1) == 1
and (ma(C,ma_Period12)[1] >= ma(C,ma_Period13)[1] and ma(C,ma_Period12) < ma(C,ma_Period13))
and countif(ma(C,ma_Period14)[1] > ma(C,ma_Period14),1) == 1
and countif(ma(C,ma_Period15)[1] > ma(C,ma_Period15),1) == 1
and countif(ma(C,ma_Period16)[1] > ma(C,ma_Period16),1) == 1
and countif(ma(C,ma_Period17)[1] > ma(C,ma_Period17),1) == 1
Then
{
T1 = -1;
}
If countif(ma(C,ma_Period21)[1] < ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] <= ma(C,ma_Period23)[1] and ma(C,ma_Period22) > ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] < ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] < ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] < ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] < ma(C,ma_Period27),1) == 1
Then
{
T2 = 2;
}
If countif(ma(C,ma_Period21)[1] > ma(C,ma_Period21),1) == 1
and (ma(C,ma_Period22)[1] >= ma(C,ma_Period23)[1] and ma(C,ma_Period22) < ma(C,ma_Period23))
and countif(ma(C,ma_Period24)[1] > ma(C,ma_Period24),1) == 1
and countif(ma(C,ma_Period25)[1] > ma(C,ma_Period25),1) == 1
and countif(ma(C,ma_Period26)[1] > ma(C,ma_Period26),1) == 1
and countif(ma(C,ma_Period27)[1] > ma(C,ma_Period27),1) == 1
Then
{
T2 = -2;
}
}
if MarketPosition == 0 and T1 == -1 and T2 == -2 and Crossup(stok,상단) and MarketPosition >= 0 then
sell("매도",AtMarket);
if MarketPosition == -1 Then
{
if Crossup(value1, value2) then
ExitShort("매도청산",AtMarket);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
미완
2018-12-11 14:55:39
미완 님에 의해 삭제된 답변입니다.