예스스탁
예스스탁 답변
2019-12-18 13:50:02
안녕하세요
예스스탁입니다.
올리신 그림에 보면 "매수"라는 이름으로 두번연속 신호가 발생했습니다.
"매수"라는 이름이 포지션의 첫진입만 유효하게 하고자 하시면
아래와 같이 조건을 주셔야 합니다.
Input : RSIPeriod(14),RSI매수값(22),SimPeriod(14),심리도값(16);
Input : N1(1),초기화(7);
Input : CCI기간(80),CCI값(300);
Input : 하락틱수(20);
Input : 분할매수횟수(2),분할매수틱수(100);
var : CCIv(0),RSIv(0),Simri(0),BuySetup(false),DD(0);
CCIv = CCI(CCI기간);
RSIV = RSI(RSIPeriod);
Simri = Simrido(SimPeriod);
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 BuySetup == true and CrossDown(CCIv,CCI값) Then
BuySetup = false;*/
if MarketPosition == 0 and BuySetup == true Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-PriceScale*분할매수틱수,1);
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 매수 진입후 100틱 아래 떨어졌을때 추가 매수 하는 수식이 할때마다 다르게 진입됨
> 최초 매수 진입하고 분할매수틱수(100) 변수에 의해 진입한 금액의 100틱 이하로 떨어졌을때
추가로 진입하는 수식인데요...
시물레이션 하면 자기 마음대로 추가 진입이 되어 버리네요..
보니까 1차 매수는 조건에 만족하는 중간봉일때 매수가 되고 2차매수는 그다음봉에 매수가 되어 버리는 것 같네요..
제가 원하는 사항은 예를들어
1차 매수 시점
if BuySetup == true Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
2차 매수 시점은 1차 매수시점에서 분할매수틱수(100) 만큼의 하락했을때 진입입니다
아래 수식이 잘못된 사항 체크 부탁드릴께요~~`
================================================================
Input : RSIPeriod(14),RSI매수값(22),SimPeriod(14),심리도값(16);
Input : N1(1),초기화(7);
Input : CCI기간(80),CCI값(300);
Input : 하락틱수(20);
Input : 분할매수횟수(2),분할매수틱수(100);
var : CCIv(0),RSIv(0),Simri(0),BuySetup(false),DD(0);
CCIv = CCI(CCI기간);
RSIV = RSI(RSIPeriod);
Simri = Simrido(SimPeriod);
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 BuySetup == true and CrossDown(CCIv,CCI값) Then
BuySetup = false;*/
if BuySetup == true Then
buy("매수",AtLimit,var1-PriceScale*하락틱수);
#추가진입
if MarketPosition == 1 and MaxEntries < 분할매수횟수 Then
buy("추가매수",atlimit,LatestEntryPrice(0)-PriceScale*분할매수틱수,1);