예스스탁
예스스탁 답변
2020-01-10 13:59:00
안녕하세요
예스스탁입니다.
식을 수정했습니다.
Input : RSIPeriod(14),RSI매수값(50),SimPeriod(14),심리도값(22);
Input : N1(1),초기화(7);
Input : CCI기간(2000),CCI값(400);
Input : 하락틱수(3000);
Input : 즉시익절1(110),즉시손절1(80);
Input : 분할매수횟수(2),분할매수틱수(45);
input : N(12);
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
{
Entry = 0;
Condition2 = true;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if TotalTrades > TotalTrades[1] and IsExitName("즉시손절1",1) == true then
Condition2 = false;
Condition1 = RSIv < RSI매수값 and Simri < 심리도값;
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 Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
#추가진입
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청산");
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1");
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 손절청산시 거래일 다음에 진입하는 수식 체크 부탁드리겠습니다
> 저번에 답변주신대로 적용해서 시뮬 돌려보내 아래 챠트와 같이 1/8일 22:01 손절청산
한후 1/9일 3시 20분에 매수진입이 되었습니다
만약에 1/8일 22:01 손절 청산시 (이익 청산시는 아님) 1/9일 07:00 이후에 조건만족시 진입될수 있도록 한번 체크부탁드림니다.
Input : RSIPeriod(14),RSI매수값(50),SimPeriod(14),심리도값(22);
Input : N1(1),초기화(7);
Input : CCI기간(2000),CCI값(400);
Input : 하락틱수(3000);
Input : 즉시익절1(110),즉시손절1(80);
Input : 분할매수횟수(2),분할매수틱수(45);
input : N(12);
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
{
Entry = 0;
Condition2 = true;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if TotalTrades > TotalTrades[1] and IsExitName("즉시손절1",1) == true then
Condition1 = false;
Condition1 = RSIv < RSI매수값 and Simri < 심리도값;
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 Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
#추가진입
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청산");
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1");
ExitLong("즉시손절1",AtStop,EntryPrice-PriceScale*즉시손절1);
}