답변완료
부탁드립니다.
항상 감사드립니다.
아래식은 익절시 +30, 손절시 -40씩 증가하게 카운트를 하고 있습니다.
(0 이하이면 0으로 수렴)
AA(300) 이상이 되면 BB(100) 도달시 까지
B1■, B2■ 와 같이 ■가 포함되게 표시하고 싶습니다.
BB(100) 도달후에는 AA(300)이상이 되기 전까지 B1, B2 로 표시
그럼 부탁드립니다.
input: BB(100), AA(300);
Input : 손절(10),익절(10),익절하락(3);
input : P1(30), P2(120), p3(240);
input : StartTime(090000),EndTime(050000);
var : tx(0),X(false),Tcond(false),tt(0);
var1 = ma(C, P1);
var2 = ma(C, P2);
var3 = ma(C, P3);
######## 진입제한
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime)Then
{
Tcond = true;
}
if (sdate != sdate[1] and stime >= Endtime) or
(sdate == sdate[1] and stime >= Endtime and stime[1] < Endtime)Then
{
Tcond = false;
}
## 진입
if Tcond == true and marketposition == 0
and crossup(var1,var2) Then
{
if Condition1 == true and tt > BB then
buy("B1■");
Else
buy("B1");
}
if Tcond == true and marketposition == 0
and crossdown(var1,var2) Then
{
if Condition1 == true and tt > BB then
sell("S1■");
Else
sell("S1");
}
if Tcond == true and marketposition == 0
and crossup(var2,var3) and var3[1] < var3 Then
{
if Condition1 == true and tt > BB then
buy("B2■");
Else
buy("B2");
}
if Tcond == true and marketposition == 0
and crossdown(var3,var4) and var3[1] > var3 Then
{
if Condition1 == true and tt > BB then
sell("S2■");
Else
sell("S2");
}
## 청산
if MarketPosition == 1 then
{
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if MarketPosition == -1 Then
{
SetStopTrailing(익절하락,익절,PointStop);
SetStopLoss(손절,PointStop);
}
if ((sdate != sdate[1] and stime >= Endtime) or
(sdate == sdate[1] and stime >= Endtime and stime[1] < Endtime)) Then
{
if MarketPosition == 1 Then
{
ExitLong("BE6");
}
if MarketPosition == -1 Then
{
ExitShort("SE6");
}
}
## 카운트
if TotalTrades > TotalTrades[1] then
{
if IsExitName("StopLoss",1) == true then
{
tt = tt - 40;
if tt <= 0 Then
{
tt = 0;
Condition1 = false;
}
if tt < AA then ###
{
tx = Text_New(ExitDate(1),ExitTime(1),h[BarsSinceExit(1)],NumToStr(tt,0));
Text_SetSize(tx,20);
Text_Setstyle(tx,2,20);
}
else
{
Condition1 = true;
tx = Text_New(ExitDate(1),ExitTime(1),h[BarsSinceExit(1)],NumToStr(tt,0)+"★");
Text_SetSize(tx,20);
Text_Setstyle(tx,2,20);
Text_SetColor(tx,MAGENTA);
}
}
if IsExitName("StopTrailing",1) == true then
{
tt = tt + 30;
if tt <= 0 Then
{
tt = 0;
X = true;
Condition1 = false;
}
if Condition1 == true and tt < BB then ###
Condition1 = false; ###
if tt < AA then ###
{
tx = Text_New(ExitDate(1),ExitTime(1),h[BarsSinceExit(1)],NumToStr(tt,0));
Text_SetSize(tx,20);
Text_Setstyle(tx,2,2);
}
else
{
tx = Text_New(ExitDate(1),ExitTime(1),h[BarsSinceExit(1)],NumToStr(tt,0)+"★");
Text_SetSize(tx,20); //Text_SetSize 폰트 사이즈
Text_Setstyle(tx,2,2); //Text_Setstyle 좌우상하 정렬
Text_SetColor(tx,MAGENTA);
}
}
} // 매매시간 이후 AA(★)부터 BB(-40)까지 마지막 지정
2020-03-19
414
글번호 137039
시스템
답변완료
수정 부탁드립니다.
안녕하세요?
아래수식의 진입은 현재
양봉 다음 음봉에 매도
음봉 다음 양봉에 매수
이렇게 되어있는데요, 이것을
양봉 다음 양봉에 매수
음봉 다음 음봉에 매도
이렇게 바꾸고 싶습니다.
수정해보려고 부등호도 한참 건드려봤으나 잘 모르겠습니다...
부탁드립니다..
input : 매수음봉틱수(5),매수양봉틱수(5);
input : 매도양봉틱수(5),매도음봉틱수(5);
input : 진입횟수(5);
input : 익절틱수(50),손절틱수(50);
var : entry(0);
#영업일 변경
if bdate != bdate[1] Then
entry = 0;
#포지션이 변경되어 새로운 진입포지션 발생시마다 1씩 증가
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매수나 무포지션 상태
C[1] == O[1]+매도양봉틱수*PriceScale and #1봉전종가가 1봉전시가+매도양봉틱수 이상
C[0] == O[0]-매도음봉틱수*PriceScale Then #현재봉 종가가 1봉전시가-매도음봉틱수 이하
sell("s");
if entry < 진입횟수 and #진입횟수가 지정한 값 이하
MarketPosition == 0 and #매도나 무포지션 상태
C[1] == O[1]-매수음봉틱수*PriceScale and #1봉전종가가 1봉전시가-매수음봉틱수 이하
C[0] == O[0]+매수양봉틱수*PriceScale Then #현재봉 종가가 1봉전시가+매수양봉틱수 이상
buy("b");
#매수진입 후 손절되면 매도로 스위칭
if MarketPosition == 1 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
#매도진입 후 손절되면 매수로 스위칭
if MarketPosition == -1 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
#목표수익 설정
SetStopProfittarget(PriceScale*익절틱수,PointStop);
2020-03-19
433
글번호 137036
시스템
답변완료
또다른 기능 요청사항입니다.
수식 부탁드림니다.
조건 1: 200봉에 상위 30% 구간에서만 활성화 하는 수식 부탁드림니다.
아래 수식에 위 조건1을 추가 부탁해요~~~
input : n(200),P(10),금액1(100000),금액2(200000);
var1 = highest(H,n);
var2 = mfi(P);
if MaxEntries < 100 and
c < var1*0.9 and
var2 < 30 and
c < o and
c <= c[1]*0.99 Then
buy("b1",OnClose,def,Floor(금액1/c));
if MaxEntries < 100 and
c < var1*0.8 and
var2 < 15 and
c < o and
c <= c[1]*0.98 Then
buy("b2",OnClose,def,Floor(금액2/c));
SetStopProfittarget(5,PercentStop);
2020-03-19
333
글번호 137018
시스템
답변완료
수식 요청합니다.
아래수식을 적용하고 있습니다.
봉매매
국내주식
추가 기능 사항
2시 30분이후에는 매수 진입/ 매수 청산 되지 않게 요청합니다.
즉 진입 / 청산 모두 9시 - 2시 30분에만 활성화될수 있는 수식 기능을 요청합니다.
input : n(200),P(10),금액1(100000),금액2(200000);
var1 = highest(H,n);
var2 = mfi(P);
if MaxEntries < 100 and
c < var1*0.9 and
var2 < 30 and
c < o and
c <= c[1]*0.99 Then
buy("b1",OnClose,def,Floor(금액1/c));
if MaxEntries < 100 and
c < var1*0.8 and
var2 < 15 and
c < o and
c <= c[1]*0.98 Then
buy("b2",OnClose,def,Floor(금액2/c));
SetStopProfittarget(5,PercentStop);
2020-03-19
341
글번호 137017
시스템