커뮤니티
문의드립니다.
2019-07-10 14:19:00
240
글번호 130223
도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다.
1. 기타.
특정시간(InitMin) 당일 저가나 고가 돌파하면 셋업 true.
그 다음에 '특정시간2'가 되면 매수진입(고가 돌파 셋업이라면) 혹은 매도진입(저가 돌파 셋업이라면)
아래 수식을 토대로 작성 부탁드립니다.
Inputs: InitMin(90);
Variables: SessStartMin(0), TradeTime(0), SetHigh(0), SetLow(0), LongFlag(False), ShortFlag(False);
#conversion of hour-based time to minute-based time
SessStartMin = TimeToMinutes(90000);
TradeTime = TimeToMinutes(sTime);
input :
진입횟수(1),
손절률(1),
익절률(1)
;
var : count(0),T1(0);
input : 진입시간(90000),제한시간(150000),청산시간(153400);
var : Tcond(false);
SetStopLoss(손절률,PercentStop);
SetStopProfittarget(익절률,PercentStop);
if stime == 청산시간 or (stime > 청산시간 and stime < 청산시간) Then{
Tcond = false;
if MarketPosition == 1 Then
exitlong();
if MarketPosition == -1 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) then
{
Tcond = true;
T1 = TotalTrades;
}
if (sdate != sdate[1] and stime >= 제한시간) or
(sdate == sdate[1] and stime >= 제한시간 and stime[1] < 제한시간) then
{
Tcond = false;
}
if MarketPosition == 0 Then
count = TotalTrades-T1;
Else
count = TotalTrades-T1+1;
if Count < 진입횟수 and Tcond == true then
{
#Setup - establishment of the initial range
If TradeTime <= SessStartMin + InitMin Then Begin
If Date <> Date[1] Then Begin
SetHigh = High;
SetLow = Low;
LongFlag = True;
ShortFlag = True;
End
Else Begin
If High > SetHigh Then
SetHigh = High;
If Low < SetLow Then
SetLow = Low;
End;
End
Else Begin
#Entries once the initial period has ended
If LongFlag AND CrossUp( Close , SetHigh) Then
Buy();
If ShortFlag AND CrossDown(Close , SetLow) Then
Sell();
End;
}
#Long Protective Exit
If MarketPosition == 1 Then Begin
LongFlag = False;
ExitLong("",atstop,SetLow );
End;
#Short Protective Exit
If MarketPosition == -1 Then Begin
ShortFlag = False;
ExitShort("",atstop,SetHigh );
End;
2. 기타
특정시간(InitMin) 당일 저가나 고가 돌파하면 고가나 저가 셋업 true.
그 다음에 '특정시간2'가 됐을 때
현 종가가
셋업고가보다 클 때 매수진입( 매도진입은 반대)
답변 1
예스스탁 예스스탁 답변
2019-07-10 16:51:31
안녕하세요
예스스탁입니다.
1
Inputs: InitMin1(90),InitMin2(180);
Variables: SessStartMin(0), TradeTime(0), SetHigh(0), SetLow(0), LongFlag(False), ShortFlag(False);
#conversion of hour-based time to minute-based time
SessStartMin = TimeToMinutes(90000);
TradeTime = TimeToMinutes(sTime);
input :
진입횟수(1),
손절률(1),
익절률(1)
;
var : count(0),T1(0);
input : 진입시간(90000),제한시간(150000),청산시간(153400);
var : Tcond(false);
SetStopLoss(손절률,PercentStop);
SetStopProfittarget(익절률,PercentStop);
if stime == 청산시간 or (stime > 청산시간 and stime < 청산시간) Then{
Tcond = false;
if MarketPosition == 1 Then
exitlong();
if MarketPosition == -1 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) then
{
Tcond = true;
T1 = TotalTrades;
}
if (sdate != sdate[1] and stime >= 제한시간) or
(sdate == sdate[1] and stime >= 제한시간 and stime[1] < 제한시간) then
{
Tcond = false;
}
if bdate != bdate[1] Then
{
LongFlag = true;
ShortFlag = false;
}
if MarketPosition == 0 Then
count = TotalTrades-T1;
Else
count = TotalTrades-T1+1;
If TradeTime >= SessStartMin and TradeTime < SessStartMin + InitMin1 Then
{
SetHigh = dayHigh;
SetLow = dayLow;
}
if TradeTime >= SessStartMin + InitMin1 then
{
if C > SetHigh Then
{
LongFlag = true;
ShortFlag = false;
}
if C < SetLow Then
{
LongFlag = false;
ShortFlag = true;
}
}
if Count < 진입횟수 and Tcond == true then
{
If LongFlag AND TradeTime >= SessStartMin + InitMin2 and TradeTime[1] < SessStartMin + InitMin2 Then
Buy();
If ShortFlag AND TradeTime >= SessStartMin + InitMin2 and TradeTime[1] < SessStartMin + InitMin2 Then
Sell();
}
#Long Protective Exit
If MarketPosition == 1 Then
{
LongFlag = False;
ExitLong("",atstop,SetLow );
}
#Short Protective Exit
If MarketPosition == -1 Then {
ShortFlag = False;
ExitShort("",atstop,SetHigh );
}
2
Inputs: InitMin1(90),InitMin2(180);
Variables: SessStartMin(0), TradeTime(0), SetHigh(0), SetLow(0), LongFlag(False), ShortFlag(False);
#conversion of hour-based time to minute-based time
SessStartMin = TimeToMinutes(90000);
TradeTime = TimeToMinutes(sTime);
input :
진입횟수(1),
손절률(1),
익절률(1)
;
var : count(0),T1(0);
input : 진입시간(90000),제한시간(150000),청산시간(153400);
var : Tcond(false);
SetStopLoss(손절률,PercentStop);
SetStopProfittarget(익절률,PercentStop);
if stime == 청산시간 or (stime > 청산시간 and stime < 청산시간) Then{
Tcond = false;
if MarketPosition == 1 Then
exitlong();
if MarketPosition == -1 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) then
{
Tcond = true;
T1 = TotalTrades;
}
if (sdate != sdate[1] and stime >= 제한시간) or
(sdate == sdate[1] and stime >= 제한시간 and stime[1] < 제한시간) then
{
Tcond = false;
}
if bdate != bdate[1] Then
{
LongFlag = true;
ShortFlag = false;
}
if MarketPosition == 0 Then
count = TotalTrades-T1;
Else
count = TotalTrades-T1+1;
If TradeTime >= SessStartMin and TradeTime < SessStartMin + InitMin1 Then
{
SetHigh = dayHigh;
SetLow = dayLow;
}
if TradeTime >= SessStartMin + InitMin1 then
{
if C > SetHigh Then
{
LongFlag = true;
ShortFlag = false;
}
if C < SetLow Then
{
LongFlag = false;
ShortFlag = true;
}
}
if Count < 진입횟수 and Tcond == true then
{
If LongFlag AND C > SetHigh and TradeTime >= SessStartMin + InitMin2 and TradeTime[1] < SessStartMin + InitMin2 Then
Buy();
If ShortFlag AND C < SetLow and TradeTime >= SessStartMin + InitMin2 and TradeTime[1] < SessStartMin + InitMin2 Then
Sell();
}
#Long Protective Exit
If MarketPosition == 1 Then
{
LongFlag = False;
ExitLong("",atstop,SetLow );
}
#Short Protective Exit
If MarketPosition == -1 Then {
ShortFlag = False;
ExitShort("",atstop,SetHigh );
}
즐거운 하루되세요
> 잡다백수 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 도움주시는 덕분에 도전하고 있습니다. 매번 감사합니다.
1. 기타.
특정시간(InitMin) 당일 저가나 고가 돌파하면 셋업 true.
그 다음에 '특정시간2'가 되면 매수진입(고가 돌파 셋업이라면) 혹은 매도진입(저가 돌파 셋업이라면)
아래 수식을 토대로 작성 부탁드립니다.
Inputs: InitMin(90);
Variables: SessStartMin(0), TradeTime(0), SetHigh(0), SetLow(0), LongFlag(False), ShortFlag(False);
#conversion of hour-based time to minute-based time
SessStartMin = TimeToMinutes(90000);
TradeTime = TimeToMinutes(sTime);
input :
진입횟수(1),
손절률(1),
익절률(1)
;
var : count(0),T1(0);
input : 진입시간(90000),제한시간(150000),청산시간(153400);
var : Tcond(false);
SetStopLoss(손절률,PercentStop);
SetStopProfittarget(익절률,PercentStop);
if stime == 청산시간 or (stime > 청산시간 and stime < 청산시간) Then{
Tcond = false;
if MarketPosition == 1 Then
exitlong();
if MarketPosition == -1 Then
ExitShort();
}
if (sdate != sdate[1] and stime >= 진입시간) or
(sdate == sdate[1] and stime >= 진입시간 and stime[1] < 진입시간) then
{
Tcond = true;
T1 = TotalTrades;
}
if (sdate != sdate[1] and stime >= 제한시간) or
(sdate == sdate[1] and stime >= 제한시간 and stime[1] < 제한시간) then
{
Tcond = false;
}
if MarketPosition == 0 Then
count = TotalTrades-T1;
Else
count = TotalTrades-T1+1;
if Count < 진입횟수 and Tcond == true then
{
#Setup - establishment of the initial range
If TradeTime <= SessStartMin + InitMin Then Begin
If Date <> Date[1] Then Begin
SetHigh = High;
SetLow = Low;
LongFlag = True;
ShortFlag = True;
End
Else Begin
If High > SetHigh Then
SetHigh = High;
If Low < SetLow Then
SetLow = Low;
End;
End
Else Begin
#Entries once the initial period has ended
If LongFlag AND CrossUp( Close , SetHigh) Then
Buy();
If ShortFlag AND CrossDown(Close , SetLow) Then
Sell();
End;
}
#Long Protective Exit
If MarketPosition == 1 Then Begin
LongFlag = False;
ExitLong("",atstop,SetLow );
End;
#Short Protective Exit
If MarketPosition == -1 Then Begin
ShortFlag = False;
ExitShort("",atstop,SetHigh );
End;
2. 기타
특정시간(InitMin) 당일 저가나 고가 돌파하면 고가나 저가 셋업 true.
그 다음에 '특정시간2'가 됐을 때
현 종가가
셋업고가보다 클 때 매수진입( 매도진입은 반대)