input : StartTime(70000),EndTime(50000),진입횟수(2);
input : 익절틱수(0),손절틱수(0);
var : Tcond(False),entry(0),SE(0),BE(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;
entry = 0;
BE = 0;
SE = 0;
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 (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if MarketPosition <= 0 and entry < 진입횟수 then
{
if entry < 1 Then
buy("b1",atlimit,dayhigh-PriceScale*250);
Else
{
if L > BE Then
buy("b2",atlimit,BE);
Else
buy("b3",AtStop,BE);
}
}
if MarketPosition == 1 Then
{
if BE == 0 Then
BE = EntryPrice;
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*500);
}
if MarketPosition >= 0 and entry < 진입횟수 Then
{
if entry < 1 Then
sell("s",atlimit,daylow+PriceScale*7000);
Else
{
if H < SE Then
Sell("s2",atlimit,SE);
Else
Sell("s3",AtStop,SE);
}
}
if MarketPosition == -1 Then
{
if SE == 0 Then
SE = EntryPrice;
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*40);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
게시판 84413 문의 내용인데요 .
1차 진입싯점에 2차도 진입이 되도록 부탁드렸는데 신호가 나오질 않습니다.
수정이 가능하지 문의 드립니다.
답변 1
예스스탁
예스스탁 답변
2023-11-07 14:20:02
안녕하세요
예스스탁입니다.
올리신 내용이면 두번째 진입이 어떤 방향으로 진입이 알수 없습니다.
단지 동일한 가격에 진입이라고 되어 있어
현재 첫신호가 매수진입이면 가격을 저장하고 이후 다음매수진입은 해당 가격을 터치할 때 하고
첫신호가 매도진입이면 가격을 저장하고 이후 다음매수진입은 해당 가격을 터치할 때 하게 되어 있습니다.
진입 후 청산에 따라 위에서 아래로 내려가서 해당 가격에 터치할 수도 있고 반대일 수도 있습니다.
두번째 진입에 대해 좀더 상황별로 정리해서질문을 다시 올려주시기 바랍니다.
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다
> input : StartTime(70000),EndTime(50000),진입횟수(2);
input : 익절틱수(0),손절틱수(0);
var : Tcond(False),entry(0),SE(0),BE(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;
entry = 0;
BE = 0;
SE = 0;
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 (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true Then
{
if MarketPosition <= 0 and entry < 진입횟수 then
{
if entry < 1 Then
buy("b1",atlimit,dayhigh-PriceScale*250);
Else
{
if L > BE Then
buy("b2",atlimit,BE);
Else
buy("b3",AtStop,BE);
}
}
if MarketPosition == 1 Then
{
if BE == 0 Then
BE = EntryPrice;
exitlong("bx",atlimit,lowest(L,BarsSinceEntry)+PriceScale*500);
}
if MarketPosition >= 0 and entry < 진입횟수 Then
{
if entry < 1 Then
sell("s",atlimit,daylow+PriceScale*7000);
Else
{
if H < SE Then
Sell("s2",atlimit,SE);
Else
Sell("s3",AtStop,SE);
}
}
if MarketPosition == -1 Then
{
if SE == 0 Then
SE = EntryPrice;
ExitShort("sx",atlimit,Highest(H,BarsSinceEntry)-PriceScale*40);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
게시판 84413 문의 내용인데요 .
1차 진입싯점에 2차도 진입이 되도록 부탁드렸는데 신호가 나오질 않습니다.
수정이 가능하지 문의 드립니다.