답변완료
키움수식인데 yes로 변환 부탁합니다
키움 수식인데 yes로 변환 부탁드립니다..
Mtm1 = C(1) - C;
Mtm2 = abs(Mtm1);
rperiod;// 변수값:12
speriod;// 변수값:26
period;;/ 변수값:9
tsi = MA(MA(Mtm1, rPeriod, 지수), sPeriod, 지수)
/
MA(MA(Mtm2, rPeriod, 지수), sPeriod, 지수) * -100;
signal=eavg(tsi,Period);
crossup(tsi,signal)
2022-03-06
1129
글번호 156963
종목검색
답변완료
수식좀 요청 드립니다.
* 아래 문장 표현좀 부탁 드립니다.
* 질문1
Condition1 = MA(C,5) ;
Condition2= MA(C,10) ;
Condition3 = MA(C,20) ; 일 경우
IF Condition1 이 20봉중 2개 이상 있어야 한다
Condition2 는 Condition2[1] 보다 커야 한다
Condition3[2]은 Condition3[1] 보다 커야 한다(전전봉신호, 전봉진호)
Condition3 는 Condition3[1] 보다 작아야 한다(현재신호, 전봉신호)
문장 좀 로직으로 작성 요청 드립니다.
질문2
## 아래수식
if c < value87[3] Then {TX11 = Text_New(sdate,stime,value87-2 , "▼");
즉 이것을 연결선으로 표시 할려고 합니다.
* 고맙습니다. 수고하십시요.
2022-03-06
1094
글번호 156962
지표
답변완료
검색결과 문의 드립니다
``wt1>60"이라는 조건에 맞지않는 결과가 나와서 문의 드립니다.
input : period1(10), period2(20);
var : a1(0), a2(0), a3(0), a4(0);
var : wt1(0), wt2(0);
a1 = ema(c,period1);
a2 = ema(abs(c-a1), period1);
a3 = (c-a1) / (0.014*a2);
a4 = ema(a3,period2);
wt1 = a4;
wt2 = ma(a4,4);
if wt1 > 60 Then Find(1);
2022-03-06
843
글번호 156960
종목검색
답변완료
시스템식 문의 드립니다.
시스템 식 작성중에 어려운 부분이 있어 글 작성합니다.
1. if condition1 == true Then
Buy("1차매수",AtMarket);
위 식에서 atmarket를 사용했을때에 투자금액을 변수로 넣고 싶습니다.
예를들어
if condition1 == true Then
Buy("상한가매수",AtStop,상한가,Floor(금액1/min(NextBarOpen,상한가)));
상한가 매수시스템식에서 floor 이후에 조건을 통해서 금액을 변수로 넣을수가
있었는데.... atmarket이나 onclose 같은 경우 (뒤에 금액이 안붙어도 되는경우)
는 투자금액을 변수로 어떻게 넣어야 할지 잘 모르겠습니다.
2. 나름 식을 작성하였는데.. 생각대로 안되는 부분이 있어 요청드립니다.
2-1 당일에는 매수만 되고 다음날에는 매도가 되어야 하는데 다음날에도 매수가 되는
경우가 있다 .어떻게 해야 하나요??
2-2 추매이후에는 매도가 안되는데 왜 안될까요 ???
3. IsEntryName("S1") == true 옆 수식에서 가장 마지막으로 들어간 매수진입명
이 맞는지요??
밑에 제가 나름 열심히 만들었는데 한번 확인 부탁드리겠습니다.
-----------------------------------------------------------------------
input :금액1(500000),상한가(36500),손절금액(300000);
input : 익절(3),익절2(1);
var : cnt(0),sum(0),mav(0),DD(0);
var : day(0),entry(False),AP(0),TT(0);
var : LL(0),RR(0),rate(0);
if Bdate != Bdate[1] Then
Condition1 = False;
if sTime > 120000 and C[0] >= DayClose(1)*1.265 Then
Condition1 = true;
if TotalTrades > TotalTrades[1] Then
entry = False;
#여기서 부터 매도하기.
if condition1 == true OR LatestExitName(1) == "4%익절" Then
Buy("상한가매수",AtStop,상한가,Floor(금액1/min(NextBarOpen,상한가)));
if condition1 == true and IsEntryName("상한가매수") == true Then
Buy("BS1(상풀)",AtLimit,상한가*0.955,Floor(금액1/min(NextBarOpen,상한가*0.955)));
if condition1 == true Then
Buy("BS1",AtLimit,Dayclose(1)*1.235,Floor(금액1/min(NextBarOpen,Dayclose(1)*1.235)));
if condition1 == true and IsEntryName("BS1") == true and sdate >= EntryDate+1 and day <=1 Then
Buy("S1",AtLimit,Dayclose(1)*1.19,Floor(금액1/min(NextBarOpen,Dayclose(1)*1.19)));
if condition1 == true and IsEntryName("BS1") == true and sTime == 150800 Then
Buy("3시10분매수(1-1)",AtMarket);
if condition1 == true and IsEntryName("3시10분매수(1-1)") == true and sTime == 151300 Then
Buy("3시15분매수(1-2)",AtMarket);
if condition1 == true and IsEntryName("3시10분매수(1-1)") == true and sTime == 151700 Then
Buy("3시19분매수(1-3)",AtMarket);
if condition1 == true and MarketPosition == 0 and sTime == 150800 Then
Buy("3시10분매수(2-1)",AtMarket);
if condition1 == true and IsEntryName("3시10분매수(2-1)") == true and sTime == 151300 Then
Buy("3시15분매수(2-2)",AtMarket);
if condition1 == true and IsEntryName("3시10분매수(2-1)") == true and sTime == 151700 Then
Buy("3시19분매수(2-3)",AtMarket);
if MarketPosition == 1 and day >=2 and DayOpen*1.04>=DayHigh Then
Buy("S1(NEXT)",AtLimit,DayHigh*0.92,Floor(금액1/min(NextBarOpen,DayHigh*0.92)));
#여기서 부터 매도하기.
if MarketPosition == 1 Then
{
if LL == 0 then
LL = L;
Else
{
if L < LL then
LL = L;
}
RR = (LL-AVGEntryPrice)/AVGEntryPrice*100;
if RR >= -0.9 Then
Rate = 익절;
if RR >= -2.9 and RR < -0.9 Then
Rate = (익절+RR);
if RR < -2.9 Then
Rate = 0.3;
ExitLong("3%익절",AtLimit,AVGEntryPrice*(1+Rate/100),"",Floor(MaxContracts*0.5));
ExitLong("4%익절",AtLimit,AVGEntryPrice*(1.01+Rate/100));
}
Else
LL = 0;
#----------------------------------------------------------------------------
# 3%, 4% 매도 청산
#----------------------------------------------------------------------------
if MarketPosition == 1 AND IsEntryName("S1") == true or IsEntryName("S1(NEXT)") == true or IsEntryName("BS1(상풀)") == true Then
{
ExitLong("0.3%익절",AtLimit,AVGEntryPrice*1.003,"",Floor(MaxContracts*0.5));
ExitLong("1%익절",AtLimit,AVGEntryPrice*1.1);
}
Else
LL = 0;
#----------------------------------------------------------------------------
# 0.3%, 1% 매도 청산
#----------------------------------------------------------------------------
if MarketPosition == 1 Then
if sdate >= EntryDate+1 and sTime == 100000 Then
{
ExitLong("다음날 10시청산");
}
#----------------------------------------------------------------------------
# 다음날 10시 청산
#----------------------------------------------------------------------------
if MarketPosition == 1 Then
ExitLong("손절",AtStop,AvgEntryPrice-손절금액/CurrentContracts);
#----------------------------------------------------------------------------
# 손절
2022-03-06
1214
글번호 156958
시스템
답변완료
수식 질문드립니다.
수식 합치는거좀 부 탁드립니다.
Option.GetATMCallRecent(n)
Option.GetATMPutRecent(n)
요걸 수정하기 위함입니다.
1. 홈페이지 스팟 메뉴얼에 있는식입니다.
var Start;
var B1CallCode;
var B1PutCode;
var S1CallCode;
var S1PutCode;
function Main_OnStart()
{
Main.MessageLog("시작");
Start = 0;
}
function C1_OnRiseSignal(Signal)
{
Main.MessageLog("신호완성/"+Signal.signalKind);
if (Signal.signalKind == 1 )
{
Start = 1;
B1CallCode = Option.GetATMCallRecent(n);
var B1CallPrice = Option.GetAskByCode(B1CallCode,2);
A1.OrderBuy(B1CallCode, Vol1, B1CallPrice, 0);
Main.MessageLog("콜매수");
}
if (Start == 1 && Signal.signalKind == 2 )
{
var B1xCallPrice = Option.GetBidByCode(B1CallCode, 2);
A1.OrderSell(B1CallCode, Vol1, B1xCallPrice, 0);
Main.MessageLog("콜매수청산");
}
if (Signal.signalKind == 3 )
{
Start = 1;
S1PutCode = Option.GetATMPutRecent(n);
var S1PutPrice = Option.GetAskByCode(S1PutCode,2);
A1.OrderBuy(S1PutCode, Vol1, S1PutPrice, 0);
Main.MessageLog("풋매수");
}
if (Start == 1 && Signal.signalKind == 4 )
{
var S1xPutPrice = Option.GetBidByCode(S1PutCode, 2);
A1.OrderSell(S1PutCode, Vol1, S1xPutPrice, 0);
Main.MessageLog("합성선물매도청산");
}
}
2.1번의 식에다가 아래 easy language 식을 넣고 싶습니다.
var : c2(0,Data2);
var : n(0);
c2 = Data2(c);
if c2>0 Then n=ceiling(c2*7/2.5);
if c2>1 Then n=ceiling(c2*5/2.5);
if c2>2 Then n=ceiling(c2*4/2.5);
if c2>3 Then n=ceiling(c2*3/2.5);
if c2>7 Then n=ceiling(c2*2.5/2.5);
#Plot1(n);
3. 여기서 문제가 메뉴얼에는 data2 부터 쓰라고 나와있는데
사진처럼 data1 써도 상관없는거죠? data1에서 datamanager 불러지던데요.
"888"은 data manager의 data 입니다.
감사합니다.
2022-03-06
1640
글번호 156957
시스템