커뮤니티
문의
2015-12-07 08:38:58
105
글번호 93122
A 라는 전략에 의해
다음 수식에 의해 신호가 나올때
아래 수식을 더하고 싶습니다.
아래 수식을 실행하려고 할때 변수 지정 과 선언을 어떻게 해야 하는지요?
" 전략 A "
에 의해 다음 수식에서 신호발생
=========== 다 음 ===========
input : b_time1(000000),e_time1(240000),목표청산1(0.1);
input : stoK_p11(20),stoK_p12(15),stoK_p13(15);
input : ma_p11(3),ma_p12(5),ma_p13(20);
input : sto1(12),sto2(3);
Var:stoK1(0),stoD1(0),stok2(0),T(0);
stok2 = StochasticsK(sto1,sto2);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK1 = StochasticsK(stoK_p11,stoK_p12);
stoD1 = StochasticsD(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))
Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort("매수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))
Then
{
T = -1;
if MarketPosition == 1 Then
ExitLong("매도1");
}
}
if T == 1 then{
if countif(stok2>stok2[1],2) == 1 and stok2[1] > 30 Then
Sell("매도");
if countif(stok2<stok2[1],2) == 1 and stok2[1] < 50 Then
ExitLong("");
}
if T == -1 then{
if countif(stok2<stok2[1],2) == 1 and stok2[1] < 50 Then
buy("매수");
if countif(stok2>stok2[1],2) == 1 and stok2[1] > 30 Then
ExitShort("");
}
@@@@@@@@@@ 아 래 @@@@@@@@@@
매매 = (EntryPrice+PriceScale)*(100+EntryCommission+ExitCommission)/100;
if 방향 <= 0 then
{
If Condition14 and time <= exTime Then
buy("본전매수",AtMarket);
If Condition34 Then {
ExitLong("본전매수청산",AtMarket);
}
If 본전청산식 > 0 and EntryPrice*(100-본전청산식)/100 > lowest(L,BarsSinceEntry) Then
ExitLong("매수본전청산",AtLimit,매매*0.1);
}
if 방향 >= 0 then
{
If Condition34 and time <= exTime Then
Sell("매도",AtMarket);
If Condition14 Then
ExitShort("매도청산",AtMarket);
If 본전청산식 > 0 and EntryPrice*(100+본전청산식)/100 < highest(H,BarsSinceEntry) Then
ExitShort("매도본전청산",AtLimit,매매*0.2);
}
답변 1
예스스탁 예스스탁 답변
2015-12-08 11:44:44
안녕하세요
예스스탁입니다.
올려주신 내용만으로 식을 합쳐드릴수가 없습니다.
아래 수식에 빠져있는 내용이 많고
단순 더한다라고만 하시면 정확한 내용을 판변이 될수 없습니다.
전략A에 다음수식을 어떤방법으로 결합하실지 내용을 상세히 올려주셔야 합니다.
매매 = (EntryPrice+PriceScale)*(100+EntryCommission+ExitCommission)/100;
if 방향 <= 0 then
{
If Condition14 and time <= exTime Then
buy("본전매수",AtMarket);
If Condition34 Then {
ExitLong("본전매수청산",AtMarket);
}
If 본전청산식 > 0 and EntryPrice*(100-본전청산식)/100 > lowest(L,BarsSinceEntry) Then
ExitLong("매수본전청산",AtLimit,매매*0.1);
}
if 방향 >= 0 then
{
If Condition34 and time <= exTime Then
Sell("매도",AtMarket);
If Condition14 Then
ExitShort("매도청산",AtMarket);
If 본전청산식 > 0 and EntryPrice*(100+본전청산식)/100 < highest(H,BarsSinceEntry) Then
ExitShort("매도본전청산",AtLimit,매매*0.2);
}
즐거운 하루되세요
> 자라도 님이 쓴 글입니다.
> 제목 : 문의
> A 라는 전략에 의해
다음 수식에 의해 신호가 나올때
아래 수식을 더하고 싶습니다.
아래 수식을 실행하려고 할때 변수 지정 과 선언을 어떻게 해야 하는지요?
" 전략 A "
에 의해 다음 수식에서 신호발생
=========== 다 음 ===========
input : b_time1(000000),e_time1(240000),목표청산1(0.1);
input : stoK_p11(20),stoK_p12(15),stoK_p13(15);
input : ma_p11(3),ma_p12(5),ma_p13(20);
input : sto1(12),sto2(3);
Var:stoK1(0),stoD1(0),stok2(0),T(0);
stok2 = StochasticsK(sto1,sto2);
If b_time1 <= Time and Time <= e_time1 Then
{
stoK1 = StochasticsK(stoK_p11,stoK_p12);
stoD1 = StochasticsD(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))
Then
{
T = 1;
if MarketPosition == -1 Then
ExitShort("매수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))
Then
{
T = -1;
if MarketPosition == 1 Then
ExitLong("매도1");
}
}
if T == 1 then{
if countif(stok2>stok2[1],2) == 1 and stok2[1] > 30 Then
Sell("매도");
if countif(stok2<stok2[1],2) == 1 and stok2[1] < 50 Then
ExitLong("");
}
if T == -1 then{
if countif(stok2<stok2[1],2) == 1 and stok2[1] < 50 Then
buy("매수");
if countif(stok2>stok2[1],2) == 1 and stok2[1] > 30 Then
ExitShort("");
}
@@@@@@@@@@ 아 래 @@@@@@@@@@
매매 = (EntryPrice+PriceScale)*(100+EntryCommission+ExitCommission)/100;
if 방향 <= 0 then
{
If Condition14 and time <= exTime Then
buy("본전매수",AtMarket);
If Condition34 Then {
ExitLong("본전매수청산",AtMarket);
}
If 본전청산식 > 0 and EntryPrice*(100-본전청산식)/100 > lowest(L,BarsSinceEntry) Then
ExitLong("매수본전청산",AtLimit,매매*0.1);
}
if 방향 >= 0 then
{
If Condition34 and time <= exTime Then
Sell("매도",AtMarket);
If Condition14 Then
ExitShort("매도청산",AtMarket);
If 본전청산식 > 0 and EntryPrice*(100+본전청산식)/100 < highest(H,BarsSinceEntry) Then
ExitShort("매도본전청산",AtLimit,매매*0.2);
}
다음글
이전글