input: n(30), k(5);
var: counting(0);
분봉 마감에서 시가 - 종가 차이가 n틱을 넘게 하락하면 1회로 카운팅하여,
3회 카운팅된때부터 다음봉 시가에 1차 매수
4회 카운팅된 후 다음봉 시가에 2차 매수
K+2회 카운팅 된 후에 다음봉 시가에 k차 매수
매수가 시작된 이후부터 최저가에서 n틱 상승 가격에 k-1회 매수분 물량 매도
카운팅은 1회로 초기화
최저가에서 2n틱 상승 가격에 나머지 1회 매수분 물량 매도
카운팅은 0회로 초기화
*n틱 대신에 n%로 바꾼 수식도 부탁드립니다
답변 1
예스스탁
예스스탁 답변
2022-07-04 15:55:31
안녕하세요
예스스탁입니다.
1
input: n(30), k(5);
var: counting(0);
if Bdate != Bdate[1] or (MarketPosition == 0 and TotalTrades > TotalTrades[1]) Then
counting = 0;
if C <= O-PriceScale*n Then
{
counting = counting+1;
if counting >= 3 and counting <= k+2 Then
Buy("b");
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
var1 = CurrentContracts-CurrentContracts[1];
Condition1 = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx1" Then
{
Condition1 = False;
counting = 1;
}
if Condition1 == true Then
ExitLong("bx1",AtLimit,lowest(L,BarsSinceEntry)+PriceScale*n,"",MaxContracts-var1,1);
ExitLong("bx2",AtLimit,lowest(L,BarsSinceEntry)+PriceScale*n*2);
}
}
2
input: n(3), k(5);
var: counting(0);
if Bdate != Bdate[1] or (MarketPosition == 0 and TotalTrades > TotalTrades[1]) Then
counting = 0;
if C <= O*(1-n/100) Then
{
counting = counting+1;
if counting >= 3 and counting <= k+2 Then
Buy("b");
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
var1 = CurrentContracts-CurrentContracts[1];
Condition1 = true;
}
if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx1" Then
{
Condition1 = False;
counting = 1;
}
if Condition1 == true Then
ExitLong("bx1",AtLimit,lowest(L,BarsSinceEntry)*(1+n/100),"",MaxContracts-var1,1);
ExitLong("bx2",AtLimit,lowest(L,BarsSinceEntry)*(1+(n*2)/100));
}
}
즐거운 하루되세요
> JTH 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input: n(30), k(5);
var: counting(0);
분봉 마감에서 시가 - 종가 차이가 n틱을 넘게 하락하면 1회로 카운팅하여,
3회 카운팅된때부터 다음봉 시가에 1차 매수
4회 카운팅된 후 다음봉 시가에 2차 매수
K+2회 카운팅 된 후에 다음봉 시가에 k차 매수
매수가 시작된 이후부터 최저가에서 n틱 상승 가격에 k-1회 매수분 물량 매도
카운팅은 1회로 초기화
최저가에서 2n틱 상승 가격에 나머지 1회 매수분 물량 매도
카운팅은 0회로 초기화
*n틱 대신에 n%로 바꾼 수식도 부탁드립니다