답변완료
거래횟수.청산수익.연장횟수.
답변 수식을 buy전용수식과 sell전용수식으로 나누어 주셨으면 합니다.
리버스 거래라 구분하기 어려워 한 번 더 요청드립니다.
buy전용)
input : Period(14);
var : HighVal(0);
HighVal = highest(H,Period)[1];
if CrossUp(C, HighVal) then
buy();
sell 전용)
input : Period(14);
var : LowVal(0);
LowVal = lowest(L,Period)[1];
if CrossDown(C,LowVal) then
sell();
********************************************************************************
안녕하세요
예스스탁입니다.
input: 거래횟수(2),청산수익(2.00),연장횟수(2);
input : Period(14);
var : HighVal(0), LowVal(0);
var : T1(0),entry(0),DayEntry(0);
if bdate != Bdate[1] Then
{
T1 = TotalTrades;
DayEntry = 거래횟수;
}
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = TotalTrades-T1+1;
HighVal = highest(H,Period)[1];
LowVal = lowest(L,Period)[1];
if CrossUp(C, HighVal) then
{
if entry < DayEntry Then
buy("b");
if MarketPosition == -1 and entry == 거래횟수 Then
{
if C <= EntryPrice-청산수익 Then
{
buy("sb");
DayEntry = 거래횟수+연장횟수;
}
Else
ExitShort("sx");
}
}
if CrossDown(C,LowVal) then
{
if entry < DayEntry Then
sell("s");
if MarketPosition == 1 and entry == 거래횟수 then
{
if C >= EntryPrice+청산수익 Then
{
sell("bs");
DayEntry = 거래횟수+연장횟수;
}
Else
ExitLong("bx");
}
}
if TotalTrades > TotalTrades[1] and MarketPosition == 0 and entry == 거래횟수 and PositionProfit(1) >= 청산수익 Then
DayEntry = 거래횟수+연장횟수;
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 68067 질문이 2개
> 68067 질문이 2개인데 첫번째만 답변주셨어요
거래횟수 n회 세팅
마지막 거래인 n회차 수익이 n포인트 이상일 경우
거래횟수 n회 연장
input: 거래횟수(2),청산수익(2.00),연장횟수(2) 세팅하면
마지막 거래인 두번째 거래 수익이 2포인트 이상이면 2회 더 거래 max 4회 거래하는 것임.
예제 수식에 반영해주십시요.
예제수식)
input : Period(14);
var : HighVal(0), LowVal(0);
HighVal = highest(H,Period)[1];
LowVal = lowest(L,Period)[1];
if CrossUp(C, HighVal) then
buy();
if CrossDown(C,LowVal) then
sell();
2020-07-19
2083
글번호 140108
시스템
답변완료
시스템 문의합니다
1번질문
1번식은 매수 버전 2번식은 매도 버전인데요
1-2번을 합쳤을때 1번의 모든 변수(28개)와 2번의 모든변수(22개)를 각각 따로 변수값을 지정할수있게 합칠수있나요? 총 50개값으로 지정할수있게 가능한가요?
매수일때 조건하고 매도 조건을 각각 따로따로 지정하고 싶어서 그런건데 가능하며 부탁드립니다
2번질문 혹시 손실이 마니나는 시스템을 buy랑 sell 만 바꾼다고해서 그손실이 수익으로 바뀌는개념은 불가능한 부분이겠죠?
-----------------------------------1번---
Input : RSIPeriod(7),RSI매수값(28),SimPeriod(14),심리도값(36); # RSI와 심리도 기간 및 값 변수
Input : N1(1),초기화(3); # 위 해당 조건 발생후 진입 유효 기간, 7일경과후 초기화
Input : 하락틱수(2); # 해당 조건 발생후 하락틱수만큼 하락후 진입 변수
Input : RSIPeriod1(6),A(0),B(4),D(48),E(72); # 일봉기준 RSI값이 해당변수안에 속해있을때 진입 변수
Input : 거래량1(600),거래량평균봉수(55),거래량평균봉수비율(3.6); # 해당 거래량1,2 사이에 속해 있을때 진입되는 변수 18000
# 1일 1회 거래
# 청산 조건 변수
Input : CCI기간(20),CCI값(500); # CCI값에 의해 청산 수식 변수
Input : 즉시익절1(70),즉시손절1(90); # 익절값 손절값 변수
Input : N2(0.6),N3(0.15); # 상승후 본절청산 관련 수식
Input : tr수익(70),tr하락(25); # 트레일링 관련 수식
Input : N4(0.7),본전생각틱(10); # 하락후 본절청산 관련 수식
Input : N5(0.8),CCI값1(120); # 약 손절 관련 수식
Input : 터치익절(105);
var : cnt(0),SigSum(0),count2(0),RSIsig(0);
Var : Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0);
var : idx(0), PreUpAvg(0), preDownAvg(0),RSIVv(0);
Array : C1[100](0);
var : CCIv(0),RSIv(0),Simri(0),BuySetup(false),DD(0),entry(0);
CCIv = CCI(CCI기간);
RSIV = RSI(RSIPeriod);
Simri = Simrido(SimPeriod);
var4 = ma(V,20);
if Bdate != Bdate[1] Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
PreUpAvg = UpAvg[1];
preDownAvg = DownAvg[1];
idx = idx + 1;
}
C1[0] = C;
If idx == RSIPeriod1+2 Then
{
UpSum = 0;
DownSum = 0;
For Counter = 0 To RSIPeriod1 - 1
{
UpAmt = C1[Counter] - C1[Counter+1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
}
UpAvg = UpSum / RSIPeriod1;
DownAvg = DownSum / RSIPeriod1;
}
If idx > RSIPeriod1+2 Then
{
UpAmt = C1[0] - C1[1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpAvg = (PreUpAvg * (RSIPeriod1 - 1) + UpAmt) / RSIPeriod1;
DownAvg = (preDownAvg * (RSIPeriod1 - 1) + DownAmt) / RSIPeriod1;
}
If UpAvg + DownAvg <> 0 Then
RSIvv = 100 * UpAvg / (UpAvg + DownAvg);
Else
RSIvv = 0;
if bdate != bdate[1] Then
{
Entry = 0;
Condition2 = true;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if TotalTrades > TotalTrades[1] and
(IsExitName("즉시손절1",1) == true or IsExitName("본전청산1",1)) then
Condition2 = false;
Condition1 = RSIv < RSI매수값 and Simri < 심리도값 and ((RSIVV > A and RSIVV < B) or (RSIVV > D and RSIVV < E)) ;
if bdate != bdate[1] Then
{
DD = DD+1;
if var2 > 0 and DD == var2+초기화 Then
BuySetup = false;
}
if BuySetup == false and Condition1 == true and Condition1[1] == false Then
{
var1 = C;
var2 = DD;
BuySetup = true;
}
if Condition2 == true and MarketPosition == 0 and C < O and C[1] < O and BuySetup == true and entry == 0
and v < ma(v,거래량평균봉수)*거래량평균봉수비율 and v > 거래량1 Then # and C < O
{
buy("매수",AtLimit,var1-PriceScale*하락틱수);
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산",OnClose);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1",OnClose);
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then
ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1*N4 and C < O Then
ExitLong("저점에서 올라와서 본전 청산",atlimit,EntryPrice+PriceScale*본전생각틱);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1 *N5 and CCIv >= CCI값1 and C < O Then
ExitLong("저점에서 올라와서 약손절",OnClose);
}
SetStopLoss(PriceScale*즉시손절1,PointStop);
SetStopProfittarget(PriceScale*터치익절,PointStop);
-----------2번----
# 매도 진입 조건 변수
Input : RSIPeriod(7),RSI매수값(65),SimPeriod(7),심리도값(45);
Input : N1(1),초기화(2);
Input : 하락틱수(5);
Input : RSIPeriod1(6),A(14),B(40),D(88),E(100);
Input : 거래량1(100),거래량평균봉수(60),거래량평균봉수비율(4); # Input : 거래량1(100),거래량2(22000);
# 청산 조건 변수
Input : 즉시익절1(70),즉시손절1(70);
Input : N2(0.25),N3(-0.75);
Input : tr수익(75),tr하락(55);
Input : N4(0.45),본전생각틱(55);
Input : 터치익절(115);
var : cnt(0),SigSum(0),count2(0),RSIsig(0);
Var : Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0);
var : idx(0), PreUpAvg(0), preDownAvg(0),RSIVv(0);
Array : C1[100](0);
var : CCIv(0),RSIv(0),Simri(0),SellSetup(false),DD(0),entry(0);
RSIV = RSI(RSIPeriod);
Simri = Simrido(SimPeriod);
if Bdate != Bdate[1] Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
PreUpAvg = UpAvg[1];
preDownAvg = DownAvg[1];
idx = idx + 1;
}
C1[0] = C;
If idx == RSIPeriod1+2 Then
{
UpSum = 0;
DownSum = 0;
For Counter = 0 To RSIPeriod1 - 1
{
UpAmt = C1[Counter] - C1[Counter+1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
}
UpAvg = UpSum / RSIPeriod1;
DownAvg = DownSum / RSIPeriod1;
}
If idx > RSIPeriod1+2 Then
{
UpAmt = C1[0] - C1[1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpAvg = (PreUpAvg * (RSIPeriod1 - 1) + UpAmt) / RSIPeriod1;
DownAvg = (preDownAvg * (RSIPeriod1 - 1) + DownAmt) / RSIPeriod1;
}
If UpAvg + DownAvg <> 0 Then
RSIvv = 100 * UpAvg / (UpAvg + DownAvg);
Else
RSIvv = 0;
if bdate != bdate[1] Then
{
Entry = 0;
Condition2 = true;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if TotalTrades > TotalTrades[1] and
(IsExitName("즉시손절1",1) == true or IsExitName("본전청산1",1)) then
Condition2 = false;
Condition1 = RSIv > RSI매수값 and Simri > 심리도값 and ((RSIVV > A and RSIVV < B) or (RSIVV > D and RSIVV < E)) ;
if bdate != bdate[1] Then
{
DD = DD+1;
if var2 > 0 and DD == var2+초기화 Then
SellSetup = false;
}
if SellSetup == false and Condition1 == true and Condition1[1] == false Then
{
var1 = C;
var2 = DD;
SellSetup = true;
}
if Condition2 == true and MarketPosition == 0 and SellSetup == true and C > O and entry == 0 and v > 거래량1
and v < ma(v,거래량평균봉수)*거래량평균봉수비율 Then
sell("매도",AtStop,var1+PriceScale*하락틱수);
if MarketPosition == -1 then
{
SellSetup = false;
SetStopProfittarget(PriceScale*터치익절,PointStop);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시익절1 and C > O Then
ExitShort("s즉시익절1",OnClose);
if Lowest(L,BarsSinceEntry) <= (EntryPrice-PriceScale*즉시익절1*N2) Then
ExitShort("s본전청산1",AtStop,EntryPrice-PriceScale*즉시익절1*N3);
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*tr수익 Then
ExitShort("str",AtStop, Lowest(L,BarsSinceEntry)+PriceScale*tr하락);
if Highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시손절1*N4 and C > O Then
ExitShort("s고점에서 내려와서 본전 청산",atlimit,EntryPrice-PriceScale*본전생각틱);
}
SetStopLoss(PriceScale*즉시손절1,PointStop);
SetStopProfittarget(PriceScale*터치익절,PointStop);
2020-06-24
1835
글번호 140106
시스템
답변완료
검색식 수정 부탁드립니다.
이제 막 수식입문한 생초보입니다.
20분봉에서 간단한 검색식을 만들었는데, 프로그램에서 20분 설정하고 검색해도 검색이 되지를 않는데
어디가 잘못 되었는지 수정부탁드립니다.
더불어 현재봉의 거래량(20분봉임)이 전일 하루 동안의 총거래량의 100%를 넘어야 된다는 조건도 넣어주시면 감사하겠습니다.
var : UPline(0),DNline(0);
UPline = EnvelopeUp(120, 3);
Dnline = EnvelopeDown(120, 3);
if
ma(c,8) > ma(c,120) && ma(c,20) > ma(c,120) && ma(c,60) > ma(c,120) &&
ma(c,240)<UPline && ma(c,240)>Dnline &&
ma(c,120)>ma(c,120)[1] && ma(c,120)[1]>ma(c,120)[2] && ma(c,120)[2]>ma(c,120)[3] &&
ma(c,120)[3]>ma(c,120)[4]
Then
find(1);
2020-06-23
1761
글번호 140097
종목검색