예스스탁
예스스탁 답변
2022-02-17 14:37:35
안녕하세요
예스스탁입니다.
지정한 최소수익 달성이후에
진입가로 돌아가면 청산하게 추가했습니다.
input: position(1),vol(1);
input : StartTime(160000),EndTime(170000),N(1000),xtime(55800),최소수익(60);
var : ST(0),Tcond(false),sumV(0),entry(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 entry < 1 then
{
if position == 1 Then
Buy("매수1",OnClose,DEf,vol);
if position == -1 Then
Sell("매도1",OnClose,DEf,vol);
}
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
ST = sTime;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true and V >= N and MarketPosition == 0 and entry < 1 then
{
if position == 1 Then
Buy("매수",OnClose,DEf,vol);
if position == -1 Then
Sell("매도",OnClose,DEf,vol);
}
if MarketPosition == 1 Then
{
if Highest(H,BarsSinceEntry) >= EntryPrice+최소수익 Then
ExitLong("bx",AtStop,EntryPrice);
}
if MarketPosition == -1 Then
{
if lowest(L,BarsSinceEntry) <= EntryPrice-최소수익 Then
ExitShort("sx",AtStop,EntryPrice);
}
IF Xtime > ST Then
SetStopEndofday(Xtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Xtime);
}
if (sdate != sdate[1] and stime >= ST) or
(sdate == sdate[1] and stime >= ST and stime[1] < ST) Then
{
IF Xtime <= ST Then
{
SetStopEndofday(0);
}
}
즐거운 하루되세요
> 스카스카 님이 쓴 글입니다.
> 제목 : 진짜 진짜 감사합니다. ^^
>
예스스탁을 알고나서 매매가 너무 편해졌어요~
삶의 질이 달아졌습니다.
너무 좋은 일을 하고계신것 같습니다. ^^
추가 요청이 있는데 구현이 될지 모르겠습니다.
감사합니다~~
트레이딩 설정에서 손절매 목표수익은 체크 해놓은 상태입니다.
60포인트 이상 익절후 본전으로 온다면 강제청산
아니라면 목표 설정 그대로 적용~ ^^
----------------------------------------------------------------------
input: position(1),vol(1);
input : StartTime(160000),EndTime(170000),N(1000),xtime(55800);
var : ST(0),Tcond(false),sumV(0),entry(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 entry < 1 then
{
if position == 1 Then
Buy("매수1",OnClose,DEf,vol);
if position == -1 Then
Sell("매도1",OnClose,DEf,vol);
}
}
if (sdate != sdate[1] and stime >= StartTime) or
(sdate == sdate[1] and stime >= StartTime and stime[1] < StartTime) Then
{
Tcond = true;
ST = sTime;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if Tcond == true and V >= N and MarketPosition == 0 and entry < 1 then
{
if position == 1 Then
Buy("매수",OnClose,DEf,vol);
if position == -1 Then
Sell("매도",OnClose,DEf,vol);
}
IF Xtime > ST Then
SetStopEndofday(Xtime);
Else
{
if sDate != sDate[1] Then
SetStopEndofday(Xtime);
}
if (sdate != sdate[1] and stime >= ST) or
(sdate == sdate[1] and stime >= ST and stime[1] < ST) Then
{
IF Xtime <= ST Then
{
SetStopEndofday(0);
}
}