예스스탁
예스스탁 답변
2024-01-31 11:45:28
안녕하세요
예스스탁입니다.
리포트의 진입/청산신호의 시간을 확인하시기 바랍니다.
리포트의 거래내역에서 청산신호는 청산이 발생한 진입의 밑에 표시되므로
피라미딩에서는 목표수익청산 아래의 진입이 실제 청산보다 시간상 이전이 있습니다.
목표수익 청산이 발생하면
그 이후의 진입만 청산 직전의 진입수량에서
일정배수로 진입하게만 작성해 드릴 수 있습니다.
input : Pst(1); // 매수,매도
input : multi(0.5);
input : gap(20),gapmulti(0.5), pt(20),sl(200),pt2(20);
var : vol(0),v1(0),t(0),s(0);
value1 = gap/PointValue;
value2 = pt/PointValue;
value3 = sl/PointValue;
#------------------------------------
# 매수 전략
#------------------------------------
if pst == 1 Then
{
if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
vol = 1;
Buy("b",OnClose,Def,vol);
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
s = 1;
v1 = CurrentContracts-CurrentContracts[1];
if MaxEntries == 1 Then
t = value1 ;
Else
t = t+Round(t*gapmulti,0);
}
if CurrentContracts < CurrentContracts[1] Then
s = -1;
if s == 1 Then
vol = Round(v1+v1*multi,0);
if s == -1 Then
vol = v1;
Buy("bb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol);
ExitLong("bp",AtLimit,AvgEntryPrice+PriceScale*Value2);
}
}
#------------------------------------
# 매도 전략
#------------------------------------
if pst == -1 Then
{
if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
vol = 1;
Sell("s",OnClose,Def,vol);
}
if MarketPosition == -1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
s = 1;
v1 = CurrentContracts-CurrentContracts[1];
if MaxEntries == 1 Then
t = value1 ;
Else
t = t+Round(t*gapmulti,0);
}
if CurrentContracts < CurrentContracts[1] Then
s = -1;
if s == 1 Then
vol = Round(v1+v1*multi,0);
if s == -1 Then
vol = v1;
Sell("ss",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol);
ExitShort("sp",AtLimit,AvgEntryPrice-PriceScale*Value2);
}
}
#--------------------------------------------
SetStopProfittarget(pt2*PriceScale,PointStop);
즐거운 하루되세요
> 양치기 님이 쓴 글입니다.
> 제목 : 시스템식 부탁드립니다.
> 항상 도움 주셔서 감사합니다.
요청 시스템식 :
매수의 경우
매수진입이후 진입가격 아래로 하락시 일정배수로 추가 매수진입 이후
전체 손익이 20틱 이상 수익 발생시 전체 청산하는 시스템식입니다.
단, 가격이 하락하여 추가 진입시 마지막 진입한 계약이 20틱 상승시
해당 계약만 익절청산 후 다시 일정배수로 진입하고 싶습니다.
아래 시스템식은 마지막 진입 계약이 20틱 익절 청산 된후
가격이 하락하면 재 진입시 기존 배수가 연속되어 진입 됩니다.
저는 익절청산 되었을 경우 배수가 마지막 배수에 이어서 진입 되었으면 합니다.
세부사항은 첨부이미지 참고 부탁드립니다.
종목 : 해외선물
input : Pst(1); // 매수,매도
input : multi(0.5);
input : gap(20),gapmulti(0.5), pt(20),sl(200),pt2(20);
var : vol(0),v1(0),t(0);
value1 = gap/PointValue;
value2 = pt/PointValue;
value3 = sl/PointValue;
#------------------------------------
# 매수 전략
#------------------------------------
if pst == 1 Then
{
if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
vol = 1;
Buy("b",OnClose,Def,vol);
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
v1 = CurrentContracts-CurrentContracts[1];
if MaxEntries == 1 Then
t = value1 ;
Else
t = t+Round(t*gapmulti,0);
}
vol = Round(v1+v1*multi,0);
Buy("bb",AtLimit,EntryPrice(0)-PriceScale*(value1*MaxEntries),vol);
ExitLong("bp",AtLimit,AvgEntryPrice+PriceScale*Value2);
}
}
#------------------------------------
# 매도 전략
#------------------------------------
if pst == -1 Then
{
if MarketPosition == 0 and TotalTrades == TotalTrades[1] Then
{
vol = 1;
Sell("s",OnClose,Def,vol);
}
if MarketPosition == -1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
v1 = CurrentContracts-CurrentContracts[1];
if MaxEntries == 1 Then
t = value1 ;
Else
t = t+Round(t*gapmulti,0);
}
vol = Round(v1+v1*multi,0);
Sell("ss",AtLimit,EntryPrice(0)+PriceScale*(value1*MaxEntries),vol);
ExitShort("sp",AtLimit,AvgEntryPrice-PriceScale*Value2);
}
}
#--------------------------------------------
SetStopProfittarget(pt2*PriceScale,PointStop);