답변완료
수식작성 부탁드립니다.
// 타 증권사 시스템 전략입니다. 예스트레이더로 전환 부탁드립니다.??
Params :
Profit_Target( 20 ), // 익절 ( 단위 : 틱 )
Stop_Loss( 30 ); // 손절 ( 단위 : 틱 )
param : BuyA_ShortLeng(5) // 단기 이동평균
, BuyA_LongLeng(20) // 장기 이동평균
, BuyA_SignalLeng(10) // SigSignal 기간
;
param : Exit_Len(10);
var : BuyA_Price1(0), BuyA_Price2(0), BuyA_Result(FALSE), SellA_Result(False) ;
var : Vol_check(False) ;
var : C_high(0), C_low(0);
if Volume > 100 Then
vol_check = true
Else
vol_check = False
;
C_high = Highest(Close, Exit_Len);
C_low = Lowest(Close, Exit_Len);
BuyA_Price1 = MACD(Close, BuyA_ShortLeng, BuyA_LongLeng);
BuyA_Price2 = Sma(MACD(Close, BuyA_ShortLeng, BuyA_LongLeng), BuyA_SignalLeng);
BuyA_Result = CrossUp(BuyA_Price1, BuyA_Price2);
SellA_Result = CrossDown(BuyA_Price1 , BuyA_Price2);
if ( BuyA_Result = true And BuyA_Price1 < 0 And vol_check = True )
Then
Begin
ExitShort("방향전환S") ;
Buy("Buy",atmarket);
End;
if ( SellA_Result = true And BuyA_Price1 > 0 And vol_check = True )
Then
Begin
ExitLong("방향전환B") ;
Sell("Sell",atmarket);
End;
if c < c_low[1] Then
Begin
ExitLong("오류진입_매수",atmarket ) ;
End;
if c > c_high[1] Then
Begin
ExitShort("오류진입_매도",atmarket) ;
End;
Var : TickSize( 0 );
TickSize = OneTick * PriceScale; // 호가 단위
SetStopProfitTarget( Profit_Target * TickSize );
SetStopLoss( Stop_Loss * TickSize );
//SetExitOnClose();
2021-11-18
472
글번호 153685
시스템
답변완료
수식수정 부탁드립니다.
현재수식은 첫번째 매수가 RSI30이하가 시작될때 입니다.
첫번째 매수를 RSI30이하로 두번 내려갈때로 수정하고 싶습니다.
두번째 매수부터는 원래대로.
매도도 원래대로.
Input : 투자금액(10000000),RSIP(14), P1(5), P2(25), P3(100), 시작일(20210805),시작시간(090000),청산시간(153000);
var : value(0),e(0),x(0),count(0),Vma(0), Tcond(false);
var : Rsiv(0),vv(0), Entry(0), mav1(0);
var1 = ma(C,p1);
var2 = ma(C,p2);
var3 = ma(C,p3);
var4 = sar(0.02,0.2);
mav1 = ma(C,30);
Rsiv = RSI(RSIP);
if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then
Tcond = true;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
count = count+1;
if sdate >= 시작일 and stime >= 시작시간 Then
Tcond = true;
if Tcond == true then
{
if crossup(c,var4) Then
Entry = 0;
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 and Entry < 1 and Crossup(Rsiv, 30) Then
buy("b1",OnClose,DEF,Floor((투자금액*0.08)/c));
if MarketPosition == 1 and Entry < 1 and CrossUp(var1,var2) and Rsiv < 70 and C > var4 and MaxEntries == 1 Then
buy("b2",atlimit,LatestEntryPrice(0)*0.99,Floor((투자금액*0.13)/min(NextBarOpen,LatestEntryPrice(0)*0.98)));
if MarketPosition == 1 and Entry < 1 and CrossUp(var1,var2) and Rsiv < 70 and C > var4 and MaxEntries == 2 Then
buy("b3",atlimit,LatestEntryPrice(0)*0.99,Floor((투자금액*0.16)/min(NextBarOpen,LatestEntryPrice(0)*0.98)));
if MarketPosition == 1 and Entry < 1 and CrossUp(var1,var2) and Rsiv < 70 and C > var4 and MaxEntries == 3 Then
buy("b4",atlimit,LatestEntryPrice(0)*0.99,Floor((투자금액*0.17)/min(NextBarOpen,LatestEntryPrice(0)*0.98)));
if MarketPosition == 1 and Entry < 1 and CrossUp(var1,var2) and Rsiv < 70 and C > var4 and MaxEntries == 4 Then
buy("b5",atlimit,LatestEntryPrice(0)*0.99,Floor((투자금액*0.21)/min(NextBarOpen,LatestEntryPrice(0)*0.98)));
if MarketPosition == 1 and Entry < 1 and CrossUp(var1,var2) and Rsiv < 70 and C > var4 and MaxEntries == 5 Then
buy("b6",atlimit,LatestEntryPrice(0)*1.00,Floor((투자금액*0.25)/min(NextBarOpen,LatestEntryPrice(0)*0.98)));
if MarketPosition == 1 and
highest(l,BarsSinceEntry) >= EntryPrice*1.10 Then
ExitLong("bx");
if MarketPosition == 1 and
Rsiv > 80 Then
ExitLong("br");
if MarketPosition == 1 and Rsiv > 65 and var1 > var2 and var2 > var3 and C < var4 Then
exitlong("s");
}
2021-11-18
480
글번호 153683
시스템
답변완료
수정 부탁드립니다
안녕하세요
아래 시스템 수정부탁드립니다.
틱 챠트에 30분봉 4등분선을 사용중이며 이 30분봉 4등분선을 가중이평 20선의 5선이
1. 25%,50%,75% 선중 위로 먼저 통과하는것에 매수
2. 25%,50%,75% 선중 아래로 먼저 통과하는것에 매도
이렇게 부탁드립니다
input : ntime(30),P(5);
var : S1(0),D1(0),TM(0),TF(0);
var : HH(0),LL(0),hh1(0),ll1(0),mav(0),ntimemav(0),sum(0),cnt(0);
Array : CC[10](0);
#기본차트이평
mav = ma(C,P);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%ntime;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or
(Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then
{
hh = h;
ll = l;
hh1 = hh[1];
ll1 = ll[1];
For cnt = 1 to 9
{
CC[cnt] = CC[cnt-1][1];
}
}
if hh > 0 and h > hh Then
hh = h;
if ll > 0 and l < ll Then
ll = l;
#30분봉 이평
if CC[P-1] > 0 Then
{
sum = 0;
For cnt = 0 to P-1
{
sum = sum +CC[cnt];
}
ntimemav = sum/P;
}
if CrossUp(mav,ll+(hh-ll)*0.25) Then
Buy("b1");
if ntimeMav > 0 and CrossUp(ntimeMav,ll1) Then
Buy("b2");
if ll1 > 0 and CrossUp(mav,ll1+(hh1-ll1)*0.25) Then
Buy("b3");
if hh1 > 0 and CrossUp(mav,hh1) Then
Buy("b4");
if CrossDown(mav,ll+(hh-ll)*0.75) Then
Sell("s1");
if ntimeMav > 0 and CrossDown(ntimeMav,hh1) Then
Sell("s2");
if ll1 > 0 and CrossDown(mav,ll1+(hh1-ll1)*0.75) Then
sell("s3");
if ll1 > 0 and CrossDown(mav,ll1) Then
Sell("s4");
}
2021-11-17
889
글번호 153681
시스템