답변완료
수식작성
1
Input : 당일수익틱수(200);
var : entry(0),mav1(0),mav2(0);
var : B(0),S(0),LL(0),HH(0);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false);
if bdate != bdate[1] Then
{
entry = 0;
Condition1 = False;
Xcond = false;
N1 = NetProfit;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true) then
Xcond = true;
}
mav1 = ma(C,2);
mav2 = ma(c,10);
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Condition1 == false and L <= DayHigh-PriceScale*100 Then
{
Condition1 = true;
B = 0;
}
if Condition1 == true Then
{
if CrossUp(mav1,mav2) Then
{
B = B+1;
if B == 1 Then
LL = Lowest(L,5);
if B == 2 and MarketPosition <= 0 and entry < 1 and Xcond == false Then
{
B = 3;
Buy("b");
}
}
}
if MarketPosition == 1 Then
{
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*100);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if CrossDown(mav1,mav2) Then
ExitLong();
}
if Condition2 == false and H >= DayLow+PriceScale*100 Then
{
Condition2 = true;
S = 0;
}
if Condition2 == true Then
{
if CrossDown(mav1,mav2) Then
{
S = S+1;
if S == 1 Then
HH = highest(H,5);
if S == 2 and MarketPosition >= 0 and entry < 1 and Xcond == false Then
Sell("s");
}
}
if MarketPosition == -1 Then
{
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*100);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if CrossDown(mav1,mav2) Then
ExitShort();
}
if sdate != sdate[1] Then
SetStopEndofday(55000);
if bdate != bdate[1] Then
SetStopEndofday(0);
2
input : StartTime1(070000),EndTime1(220000),진입횟수1(1);
input : StartTime2(220000),EndTime2(055000),진입횟수2(2);
input : Xtime(055000),당일수익틱수(200);
var : entry(0),Tcond1(false),Tcond2(False);
Var : N1(0),dayPl(0),당일수익(0),Xcond(false),mav1(0),mav2(0),B(0),S(0),HH(0),LL(0);
mav1 = ma(C,2);
mav2 = ma(c,10);
if (sdate != sdate[1] and stime >= EndTime1) or
(sdate == sdate[1] and stime >= EndTime1 and stime[1] < EndTime1) Then
Tcond1 = False;
if (sdate != sdate[1] and stime >= StartTime1) or
(sdate == sdate[1] and stime >= StartTime1 and stime[1] < StartTime1) Then
{
Tcond1 = true;
entry = 0;
Xcond = false;
N1 = NetProfit;
Condition1 = False;
Condition2 = False;
}
if (sdate != sdate[1] and stime >= EndTime2) or
(sdate == sdate[1] and stime >= EndTime2 and stime[1] < EndTime2) Then
Tcond2 = False;
if (sdate != sdate[1] and stime >= StartTime2) or
(sdate == sdate[1] and stime >= StartTime2 and stime[1] < StartTime2) Then
{
Tcond2 = true;
entry = 0;
Condition1 = False;
Condition2 = False;
}
당일수익 = PriceScale*당일수익틱수;
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] then
{
if daypl >= 당일수익 Then
Xcond = true;
if (IsExitName("dbp",1) == true or IsExitName("dsp",1) == true) then
Xcond = true;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Condition1 == false and L <= DayHigh-PriceScale*160 Then
{
Condition1 = true;
B = 0;
}
if Condition1 == true Then
{
if CrossUp(mav1,mav2) Then
{
B = B+1;
if B == 1 Then
LL = Lowest(L,5);
if B == 2 and MarketPosition <= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then
{
B = 3;
Buy("b");
}
}
}
if MarketPosition == 1 Then
{
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*100);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
if CrossDown(mav1,mav2) Then
ExitLong();
}
if Condition2 == false and H >= DayLow+PriceScale*200 Then
{
Condition2 = true;
S = 0;
}
if Condition2 == true Then
{
if CrossDown(mav1,mav2) Then
{
S = S+1;
if S == 1 Then
HH = highest(H,5);
if S == 2 and MarketPosition >= 0 and Xcond == False and ((Tcond1 == true and entry < 진입횟수1) or (Tcond2 == true and entry < 진입횟수2)) Then
Sell("s");
}
}
if MarketPosition == -1 Then
{
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*150);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
if CrossUp(mav1,mav2) Then
ExitShort();
}
if sdate != sdate[1] Then
SetStopEndofday(Xtime);
if bdate != bdate[1] Then
SetStopEndofday(0);
-----------
2가지 수식어의 추가 입니다.
조건만족후
buy 진입은 2분 10분 2회 골든크로스
buy 청산은 2분 10분 1회 데드크로스
진입의 손절은 1번째 골든크로스 전 캔들5봉 후 캔들5봉 의 저점의 이탈 입니다.
반대포지션도 동일 내용이며 당일 목표수익은 200틱의 수식어도 부탁드립니다.
-----
위 내용은 72528 번의 수식어 작성문안 입니다. 아래 내용으로 수정을 부탁드립니다
" buy 진입신호후 2분 10분 2번째 골든크로스에서 실주문후
손절은 2번째 골든크로스 앞뒤 캔들8봉 의 저점 2틱 이탈시 입니다.
반대포지션도 동일 내용이며 당일 목표수익은 200틱의 수식어도 부탁드립니다."
2021-05-21
1223
글번호 149218
시스템
답변완료
수식 부탁드립니다
주차트 일봉 차트에 참조데이타(Data2)를 쓰지않고 아래수식
1. 주봉의 MinLRL,MinLRL[k+1] 값을 나타내고 싶습니다.
2. 월봉의 MinLRL,MinLRL[k+1] 값을 나타내고 싶습니다.
/////////////////////////////////////////////////////////////////
Var:n(19),j(0),k(0),계산주기(0),X(0),sumXY(0),sumX(0),sumY(0),sumX²(0), MinLRS(0),MinB(0),MinLRL(0);
Array:MinClose[100](0);
k = k + 1;
if DayIndex()%계산주기 == 0 then {
for j = 98 downto 0 {
MinClose[j+1] = MinClose[j];
}
X = X + 1;
k = 0;
}
MinClose[0] = C;
sumXY = 0; sumX = 0; sumY = 0; sumX² = 0;
For j = 0 To n-1 {
sumXY = sumXY + (X-j)*MinClose[j];
sumX = sumX + (X-j);
sumY = sumY + MinClose[j];
sumX²= sumX²+ (X-j)^2;
}
MinLRS = (n*sumXY - sumX*sumY)/(n*sumX²- sumX^2);
MinB = (sumY*sumX²-sumX*sumXY)/(n*sumX²- sumX^2);
MinLRL = MinLRS * X + MinB;
//////////////////////////////////////////////////////////////////////////
항상 고맙습니다.
2021-05-21
1149
글번호 149217
지표
답변완료
피라미딩 주문이 안들어가는데 검토 좀 부탁드립니다.
안녕하세요.
저번에 알려주신 수식을 참고해서 피라미딩 매매식을 가격지정해서 하고 있는데 처음 매도에만
체결이 되고, 2번째는 매도 추가 진입이 안들어가드라구요.
피라미딩 조건 설정에서도 다른신호 진입으로 해놨거든요.
그런데 시뮬레이션 차트에서는 저 수식으로 하면 제가 생각했던대로 매매가 되는데,
전략실행 차트에서는 첫번째 매도 주문만 들어가고, 그 다음에는 안들어가지더라구요.
혹시 이게 처음 들어가 있는 것에대해 STOP 주문이 설정되어 있어서 그런건가요?
수동매매할때는 가장매매의심거래라고 떠서 일일이 추가 매수,매도 하기전에 STOP 걸었던것을
풀어주고 주문을 걸어서 하는데...
뭐가 잘못된건지 알려주시면 고맙겠습니다.
매매종목 : 해외선물(AUD) 5분봉
거래일자 : 2021.05.21
==============================================================
input : BPrice1(0.77845),BPrice2(0.77945),BPrice3(0.78045),Bprice4(0.78145),Bprice5(0.78245);
input : SPrice1(0.77645),SPrice2(0.77545),SPrice3(0.77445),Sprice4(0.77345),Sprice5(0.77245);
input : pt(0.0019);
if sDate != sDate[1] Then
SetStopEndofday(55500);
if Bdate != Bdate[1] Then
SetStopEndofday(0);
if h < Bprice1 Then
Buy("b1",AtStop,Bprice1);
if h < Bprice2 Then
Buy("b2",AtStop,Bprice2);
if h < Bprice3 Then
Buy("b3",AtStop,Bprice3);
if h < Bprice4 Then
Buy("b4",AtStop,Bprice4);
if h < Bprice5 Then
Buy("b5",AtStop,Bprice5);
if L > Sprice1 Then
Sell("s1",AtStop,Sprice1);
if h < Sprice2 Then
Sell("s2",AtStop,Sprice2);
if h < Sprice3 Then
Sell("s3",AtStop,Sprice3);
if h < Sprice4 Then
Sell("s4",AtStop,Sprice4);
if h < Sprice5 Then
Sell("s5",AtStop,Sprice5);
SetStopLoss(pt,PointStop);
2021-05-21
1222
글번호 149212
시스템
답변완료
주봉으로 주문
안녕하세요?
항상 감사드립니다.
주봉으로 변동성 돌파 전략을 사용하고 싶은데요,
밑에 dayopen, dayhigh, daylow, dayclose 부분은 주봉 부분으로 바꾸고 싶고..
실제로 아래 컨셉으로 주문을 내고 싶은데,
주문 부분 및 부족한 부분 가이드좀 부탁드립니다.
var:RangV(0), cnt(0), sumV(0), avgV(0);
RangV = H[1] - L[1];
sumV = 0;
for cnt = 19 downto 0 {
sumV = sumV + RangV[cnt];
}
avgV = sumV / 20;
var : n(20),k(0.5);
var : noise(0),sum(0),cntN(0);
sum = 0;
for cntN = 1 to N
{
sum = sum + (1-abs(dayopen(cntN)-DayClose(cntN))/(DayHigh(cntN)-daylow(cntN)));
}
noise = sum/n;
if
H > O + avgV * noise
Then {
주문
}
다음봉 시가 or 다음봉 종가 청산
2021-05-20
956
글번호 149196
시스템