예스스탁
예스스탁 답변
2021-11-18 11:11:17
안녕하세요
예스스탁입니다.
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),cnt(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 tcond[1] == False or (MarketPosition == 0 and TotalTrades > TotalTrades[1]) Then
cnt = 0;
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 Crossup(Rsiv, 30) Then
{
cnt = cnt+1;
if cnt == 2 and MarketPosition == 0 and Entry < 1 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");
}
즐거운 하루되세요
> 바나 님이 쓴 글입니다.
> 제목 : 수식수정 부탁드립니다.
> 현재수식은 첫번째 매수가 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");
}