예스스탁
예스스탁 답변
2023-11-13 14:29:15
안녕하세요
예스스탁입니다.
1
수식에 시간조건이 들어가면 모두 분봉이하 주기에 적용하셔야 합니다.
일봉에서 시간을 조건으로 제어는 가능하지 않습니다.
2
수식에서 Tcond가 지정한 시간 이내임을 체크하는 변수입니다.
현재 올리시는 수식에서 if tcond == true then
안에 포함된 신호들도 있고 아닌 신호들도 있습니다.
if tcond == true then
{
}
지정한 시간이내에 발생하는 신호들 위 if문 안에 포함시키셔야 합니다.
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input : StartTime(180000),EndTime(40000);
input : 익절틱수(0),손절틱수(50);
var : Tcond(False),entry(0);
Variables: Mom(0);
IF Endtime > starttime Then
SetStopEndofday(Endtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Endtime);
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
IF Endtime <= starttime Then
{
SetStopEndofday(0);
}
}
if (sdate != sdate[1] and stime >= EndTime) or
(sdate == sdate[1] and stime >= EndTime and stime[1] < EndTime) Then
{
Tcond = False;
}
if Tcond == true Then
{
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
Sell();
}
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*1 Then
{
Sell("s",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
Buy();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b1",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
Sell();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then
{
Sell("s1",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
Buy();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b2",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
Sell();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then
{
Sell("s2",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
Buy();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*1 Then
{
Buy("b3",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
Sell();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*1 Then
{
Sell("s3",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
Buy();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b4",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
Sell();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then
{
Sell("s4",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
Buy();
if L ==lowest(L,1) and highest(H,3) >= lowest(L,2)+PriceScale*10 Then
{
Buy("b5",AtStop,(highest(H,3)+lowest(L,1))/2);
}
if MarketPosition == 1 and BarsSinceEntry == 9 Then
Sell();
if H == highest(H,1) and lowest(L,3) <= highest(H,2)+PriceScale*10 Then
{
Sell("s5",AtStop,(lowest(L,3)+highest(H,1))/2);
}
if MarketPosition == -1 and BarsSinceEntry == 9 Then
Buy();
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
위 수식어를 분봉으로 확인하고 있습니다.
일봉으로 테스트하면 실제로 장중 위 시간때에만 신호가 주어지는건지
문의해 봅니다.