답변완료
국내 주식 수식 부탁드려요
국내 주식 ETF 용 분할매수 청산 수식인데요
여기에 추가하고 싶은 기능이 있습니다.
매수진입한 것이 매수 청산되지 않는 상태라면 200봉(변수지정) 경과후 양봉에 매수청산
( 수익여부와 상관없이) 하는 수식이 가능한지요??
input : n(200),P(10),금액1(100000),금액2(200000);
var1 = highest(H,n);
var2 = mfi(P);
if MaxEntries < 100 and
c < var1*0.9 and
var2 < 30 and
c < o and
c <= c[1]*0.99 Then
buy("b1",OnClose,def,Floor(금액1/c));
if MaxEntries < 100 and
c < var1*0.8 and
var2 < 15 and
c < o and
c <= c[1]*0.98 Then
buy("b2",OnClose,def,Floor(금액2/c));
SetStopProfittarget(5,PercentStop);
2020-03-13
362
글번호 136840
시스템
답변완료
문의드립니다.
아래 수식은 지표식 수식입니다.
input : Period(14),Period1(20),Period2(30),Period3(40);
var1 = WMA(2*WMA(c, Period/2) - WMA(c, Period), Sqrt(Period));
var2 = WMA(2*WMA(c, Period1/2) - WMA(c, Period1), Sqrt(Period1));
var3 = WMA(2*WMA(c, Period2/2) - WMA(c, Period2), Sqrt(Period2));
var4 = WMA(2*WMA(c, Period3/2) - WMA(c, Period3), Sqrt(Period3));
plot1(var1,"수식1");
plot2(var2,"수식2",iff(var2>var2[1],RED,BLUE));
plot3(var3,"수식3");
plot4(var4,"수식4");
여기에서
Period1(20) 이선이 상승시 빨강 하락시 파랑인데요...
이선이 파랑색에서 빨강색이 될때
빨강색에서 파란색이 될때
이렇게 시스템 신호를 넣어 보고 싶어서 문의 드립니다.
화살표가 나오면서 소리를 넣고 싶어서요...
2020-03-12
333
글번호 136837
시스템
답변완료
수식좀 봐주실래요? 하루에 1회만 진입하는 수식으로 알고 있는데
수식좀 봐주실래요? 하루에 1회만 진입하는 수식으로 알고 있는데
지금 이시간에 하루에 3회까지 진입이되네요...
혹시나해서 아래 전략으로 이전 거래 사항을 보면 이렇게까지 하루에 몇번씩 진입된적이 없었
는데 혹시 어떤 원인인지 알수 있을까요??
그리고 제가 원하는 아래 수식에 1일 / 1회진입만 하는 수식 반영 부탁드릴께요~~
혹시 확인 가능할까요?
Input : RSIPeriod(7),RSI매수값(32),SimPeriod(7),심리도값(16);
Input : N1(1),초기화(7);
Input : CCI기간(20),CCI값(400),CCI값1(120);
Input : 즉시익절1(340),즉시손절1(160);
Input : 분할매수횟수(1),분할매수틱수(50);
Input : RSIPeriod1(8),A(74),B(20);
Input : N2(0.6),N3(0.02);
Input : 저점손절틱수(35);
Input : 거래량1(1000),거래량2(20000);
Input : tr수익(220),tr하락(150);
Input : N4(0.6),N5(0.5);
Input : 본전생각틱(35);
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);
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 and v > 거래량1 and v < 거래량2 ;
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 BuySetup == true and C < O Then
buy("매수",OnClose);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-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);
Else
{
if L <= EntryPrice-PriceScale*즉시손절1 Then
ExitLong("즉시손절1",AtStop,L-PriceScale*저점손절틱수);
}
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);
}
2020-03-13
159
글번호 136833
시스템