답변완료
질문드립니다
안녕하세요
아래는 보조지표 스토캐스틱 수치를 이용한 청산식입니다.
if MarketPosition == -1 Then{
if IsEntryName("S") == true Then
if Stok <= 15.0 Then
ExitShort("S청산", OnClose, DEF, "S", 1,1);
if Stok <= 10.0 Then
ExitShort("S청산2", OnClose, DEF, "S", 1,1);
}
"Onclose" 조건이기 때문에 캔들이 끝나야만 청산이 이루어집니다.
이것을 스토캐스틱 수치가 '15' 과 '10'을 닿는 순간 청산되도록 하려면 어떻게 해야 하는지 알려주시면 감사하겠습니다.
2021-03-04
817
글번호 146801
시스템
답변완료
부탁드립니다
$,안녕하세요
1,첨부파일의 내용은 일봉차트에 아래식을 적용하여 지표속성차트표시에서 사각형그래프
를 굵기최대로 적용한 사례입니다.첨부파일처럼 분봉이나 틱봉에서도 같은 스타일로
현재봉 위아래에 점이나 사각그래프와 같은 하나의 모양으로만 표시하고 싶은데 방법을
모르겠습니다,타주기분봉으로 식을짜야 할지 잘 모르겠습니다,도움부탁드립니다.
input : N(0);
var1 = DateToJulian(CurrentDate);
if var1 > 0 and DateToJulian(sDate) >= var1-N Then
{
Plot1(DayHigh(1)+(DayHigh(1)-DayLow(1)),"HL상");
plot2(DayClose(1)+(DayHigh(1)-DayLow(1)),"CHL상");
Plot3(DayLow(1)-(DayHigh(1)-DayLow(1)),"HL하");
plot4(DayClose(1)-(DayHigh(1)-DayLow(1)),"CHL하");
}
2,최근 N일동안의 시가평균선과 종가평균선을 직선으로 오른쪽그리기 하고싶습니다,
함수로직 부탁드립니다.
$,관리자님의 도움주심에 항상 고맙습니다.
2021-03-05
918
글번호 146800
지표
답변완료
전략변환~
안녕하세요?
시그널메이커에서 예스로 이사중입니다.변환 부탁드립니다.^^
Params : Exit_Loss(200), Exit_Profit_Today(900), Exit_Loss_Today(240), BuyProfit(450), SellProfit(450);
Params : TradingStartTime(111800), TradingEndTIME(034500);
Params : trailing_up_price1(150), trailing_stop_price1(130),trailing_up_price2(90), trailing_stop_price2(80),trailing_up_price3(50), trailing_stop_price3(1), up_price_high(145), up_price_high_stop(20), x_value(60);
vars : t1(1), Today_P(0), Pre_NetProfit(0), LossPoint(0), ProfitPoint(0), myOpenProfit(0), TickPoint(0);
Vars : SP(0), R(0), R_1(0), S(0), S_1(0);
Vars : st(0), et(0);
V1 = Dayofweek((10000 * Year(D)) + (100 * 3) + 1);
If V1 = 0 Then Value2 = 8
Else Value2 = 15 - V1; // 3월 두번째 일요일 날짜
V2 = Dayofweek((10000 * Year(D)) + (100 * 11) + 1);
If V2 = 0 Then Value4 = 1
Else value4 = 8 - V2; // 11월 첫번째 일요일 날짜
If date > (10000 * Year(D)) + (100 * 3) + value2
And date < (10000 * Year(D)) + (100 * 11) + value4 Then
Begin
st = 070000; // 써머타임 적용 시, 장시작 시간
et = 060000; // 써머타임 적용 시, 장종료 시간
End
Else
Begin
st = 080000; // 장 시작 시간
et = 070000; // 장 종료 시간
End;
condition1 = (IntPortion(time/10000) > IntPortion(et/10000) And IntPortion(time[1]/10000) <= IntPortion(et/10000)) Or st <> st[1];
R = highest(H, X_value);
R_1 = R[1];
S = lowest(L, X_value);
S_1 = S[1];
SP = SignalPosition;
TickPoint = OneTick * PriceScale;
Vars : PPosit(0);
if condition1 Then
Begin
ProfitPoint = 0;
Today_P = 0;
Pre_NetProfit = NetProfit[1];
Cond99 = false;
pPosit = 0;
End;
IF ExitDate(1) = Date Then pPosit = SignalPosition(1)
Else pPosit = 0;
Today_P = NetProfit - Pre_NetProfit; // 하루 누적 수익
myOpenProfit = OpenPositionProfit;
If (Today_P + myOpenProfit) >= (Exit_Profit_Today * TickPoint) Then Cond99 = true
Else If (Today_P + myOpenProfit) <= -(Exit_Loss_Today * TickPoint) Then Cond99 = True;
if TradingStartTime < TradingEndTIME Then
Begin
If TradingStartTime <= TIME And TIME <= TradingEndTIME Then COND44 = True
Else COND44 = False;
End
Else
Begin
If TradingStartTime <= TIME Or TIME <= TradingEndTIME Then COND44 = True
Else COND44 = False;
End;
If Cond44 = False Then
Begin
if SP <> 0 Then
Begin
ExitLong("마감 매수 청산",OnClose,def,def,CurrentContracts);
ExitShort("마감 매도 청산",OnClose,def,def,CurrentContracts);
End;
Cond44 = False;
End;
LossPoint = -Exit_Loss_Today * TickPoint - Today_P - myOpenProfit;
ProfitPoint = Exit_Profit_Today * TickPoint - Today_P - myOpenProfit;
if 1 = Sp then
Begin
ExitLong("매수 익절마감", Atlimit, close + ProfitPoint);
ExitLong("매수 손절마감", Atstop, close + LossPoint);
ExitLong("매수청산", Atlimit, EntryPrice + BuyProfit * TickPoint );
End
Else if -1 = Sp then
Begin
ExitShort("매도 익절마감", Atlimit, close - ProfitPoint);
ExitShort("매도 손절마감", Atstop, close - LossPoint);
ExitShort("매도 청산", Atlimit, EntryPrice - SellProfit * TickPoint );
End;
//지정한 시간대에만 거래
if Cond44 And false = Cond99 Then
Begin
// 매수 진입
If SP[1] <> 1 And PPosit <> 1 And time >= T1 And (CrossUp(c, R_1) Or CrossDown(C, S_1)) And C > R_1 Then Buy();
//매도 진입
If SP[1] <> -1 And PPosit <> -1 And CrossDown(C, S_1) Then Sell();
End;
SetStopLoss(Exit_Loss * tickpoint);
var : TickSize(0);
TickSize = OneTick * PriceScale;
If MaxContractProfit < TickSize * (trailing_up_price1 + 10) Then SetStopTrailing(TickSize * trailing_stop_price1, TickSize * trailing_up_price1)
Else if MaxContractProfit < TickSize * (trailing_up_price2 + 10) Then setstopTrailing(TickSize * trailing_stop_price2, TickSize * trailing_up_price2)
Else SetStopTrailing(TickSize * trailing_stop_price3, TickSize * trailing_up_price3);
var : TickSize2(0), oC(0), oC_b1(0), oC_s1(0), oC_b2(0), oC_s2(0), oC_b3(0), oC_s3(0);
TickSize2 = OneTick * PriceScale;
If MaxPositionProfit >= up_price_high * TickSize2 Then
Begin
ExitLong("EXB12", AtStop, EntryPrice + up_price_high_stop * TickSize2);
ExitShort("EXS12", AtStop, EntryPrice - up_price_high_stop * TickSize2);
End;
2021-03-04
804
글번호 146798
시스템
답변완료
종목검색이 제대로 안되는 것 같습니다.
안녕하세요. 아래와 같은 조건검색식을 만들어서 파워검색을 실시해보면, 1000여종목이 검색이 됩니다. 로직에 맞지 않는 종목도 다 올라오는데... 어떤 부분이 에러인지 점검 좀 부탁드립니다. 감사합니다.
// 3분봉으로 검색
var : ma3(0), ma5(0), ma10(0), ma20(0), ma120(0), gap(0);
var : 강세조건(0), 연속조건(0);
ma3 = ma(c,3);
ma5 = ma(c,5);
ma10 = ma(c,5);
ma20 = ma(c,5);
ma120 = ma(c,5);
gap = ma5/ma120 * 100;
if gap > 99 && gap < 105 && ma3[1] < ma3 && ma5[1] < ma5 && ma10[1] < ma10 && ma120[1] < ma120 Then
강세조건 = 1; //
if ma5[3] < c[3] && ma5[2] < c[2] && ma5[1] < c[1] && ma5 < c Then
연속조건 = 1;
if 강세조건 == 1 && 연속조건 == 1 then
Find(1);
2021-03-04
921
글번호 146789
종목검색
답변완료
문의
첫번째 진입 b1 이
bx1 이나 강제손절,익절,트레일링으로 청산된 이후
b2 진입 프로세스를 진행하는 것이 아니라
b1 -> bx1으로 청산되었다면 60 봉이 지난 후부터
b1 -> 강제손절로 청산되었다면 50 봉이 지난 후부터
b1 -> 강제익절로 청산되었다면 40 봉이 지난 후부터
b1 -> 강제트레일링으로 청산되었다면 30 봉이 지난 후부터
b2 진입 프로세스를 진행하는 수식을 추가해주십시요.
b1 청산 종류별로 일정 term을 가진 후 진입하자는 취지입니다.
************************************************************************************
input : b1(45),b2(380),X1(200),X2(100);
input : stop(300),limit(1000),trail(500);
var : T1(0,data1),entry(0,data1),LL(0,data2),EH(0,data2),C2(0,data1);
C2 = data2(C);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+1;
if MarketPosition == 0 and entry == 0 and
data2(C >= lowD(0)+PriceScale*B1 and C[1] < lowD(0)+PriceScale*B1) Then
buy("b1");
if MarketPosition == 1 Then{
if CurrentContracts > CurrentContracts[1] Then
EH = data2(H);
if data2(H) > EH Then
EH = data2(H);
if entry == 1 and data2(C <= EH-PriceScale*X1) Then
exitlong("bx1");
}
if TotalTrades > TotalTrades[1] Then
LL = data2(L);
if data2(L) < LL Then
LL = data2(L);
if MarketPosition == 0 and entry == 1 and
data2(C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2) Then
buy("b2");
if MarketPosition== 1 and entry == 2 and
data2(L) <= C2[BarsSinceEntry]-data2(PriceScale*X2) Then
exitlong("bx2");
SetStopLoss(stop,PointStop);
SetStopProfittarget(limit,PointStop);
SetStopTrailing(trail,0,PointStop);
2021-03-04
815
글번호 146782
시스템