커뮤니티
시스템
2019-02-18 19:57:40
141
글번호 126308
안녕하세요 수고하십니다
아래식은 매수부분을 참조해서 매도쪽 시스템을 완성했는데
매도쪽이 엉터리같습니다 매도쪽 수정부탁드립니다
input : b1(20),b2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0),EL(0),HH(0);
if Bdate != Bdate[1] Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and
C >= daylow+PriceScale*B1 and C[1] < daylow+PriceScale*B1 Then
buy("b1");
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
EH = H;
if H > EH Then
EH = H;
if entry == 1 and C <= EH-PriceScale*X1 Then
exitlong("bx1");
}
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then
buy("b2");
if MarketPosition== 1 and entry == 2 Then
ExitLong("bx2",AtStop,EntryPrice-PriceScale*X2);
아래쪽 수정부탁드립니다
if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and
C <= dayhigh+PriceScale*B2 and C[1] > dayhigh+PriceScale*B2 Then
sell("s1");
if MarketPosition == -1 Then
{
if CurrentContracts < CurrentContracts[1] Then
EL = L;
if L > EL Then
EL = L;
if entry == 1 and C >= EL+PriceScale*X2 Then
ExitShort("sx1");
}
if TotalTrades < TotalTrades[1] Then
HH = H;
if H > HH Then
HH = H;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*B1 and C[1] > HH-PriceScale*B1 Then
sell("s2");
if MarketPosition== -1 and entry == 2 Then
ExitShort("sx2",AtStop,EntryPrice-PriceScale*X2);
답변 1
예스스탁 예스스탁 답변
2019-02-19 10:26:54
안녕하세요
예스스탁입니다.
매도 쪽은 진입이후의 최저가와 매도 청산이후 최고가를 계산하게 작성하셔야 합니다.
input : b1(20),b2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0),EL(0),HH(0);
if Bdate != Bdate[1] Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if MarketPosition == 0 and
entry == 0 and
stime >= 진입시간 and
C >= daylow+PriceScale*B1 and C[1] < daylow+PriceScale*B1 Then
buy("b1");
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
EH = H;
if H > EH Then
EH = H;
if entry == 1 and C <= EH-PriceScale*X1 Then
exitlong("bx1");
}
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then
buy("b2");
if MarketPosition== 1 and entry == 2 Then
ExitLong("bx2",AtStop,EntryPrice-PriceScale*X2);
if MarketPosition == 0 and
entry == 0 and
stime >= 진입시간 and
C <= dayhigh+PriceScale*B2 and C[1] > dayhigh+PriceScale*B2 Then
sell("s1");
if MarketPosition == -1 Then
{
if CurrentContracts > CurrentContracts[1] Then
EL = L;
if L < EL Then
EL = L;
if entry == 1 and C >= EL+PriceScale*X2 Then
ExitShort("sx1");
}
if TotalTrades < TotalTrades[1] Then
HH = H;
if H > HH Then
HH = H;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*B1 and C[1] > HH-PriceScale*B1 Then
sell("s2");
if MarketPosition== -1 and entry == 2 Then
ExitShort("sx2",AtStop,EntryPrice-PriceScale*X2);
즐거운 하루되세요
> 유인력11 님이 쓴 글입니다.
> 제목 : 시스템
> 안녕하세요 수고하십니다
아래식은 매수부분을 참조해서 매도쪽 시스템을 완성했는데
매도쪽이 엉터리같습니다 매도쪽 수정부탁드립니다
input : b1(20),b2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0),EL(0),HH(0);
if Bdate != Bdate[1] Then
entry = 0;
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and
C >= daylow+PriceScale*B1 and C[1] < daylow+PriceScale*B1 Then
buy("b1");
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
EH = H;
if H > EH Then
EH = H;
if entry == 1 and C <= EH-PriceScale*X1 Then
exitlong("bx1");
}
if TotalTrades > TotalTrades[1] Then
LL = L;
if L < LL Then
LL = L;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C >= LL+PriceScale*B2 and C[1] < LL+PriceScale*B2 Then
buy("b2");
if MarketPosition== 1 and entry == 2 Then
ExitLong("bx2",AtStop,EntryPrice-PriceScale*X2);
아래쪽 수정부탁드립니다
if MarketPosition == 0 and entry == 0 and stime >= 진입시간 and
C <= dayhigh+PriceScale*B2 and C[1] > dayhigh+PriceScale*B2 Then
sell("s1");
if MarketPosition == -1 Then
{
if CurrentContracts < CurrentContracts[1] Then
EL = L;
if L > EL Then
EL = L;
if entry == 1 and C >= EL+PriceScale*X2 Then
ExitShort("sx1");
}
if TotalTrades < TotalTrades[1] Then
HH = H;
if H > HH Then
HH = H;
if MarketPosition == 0 and entry == 1 and stime >= 진입시간 and C <= HH-PriceScale*B1 and C[1] > HH-PriceScale*B1 Then
sell("s2");
if MarketPosition== -1 and entry == 2 Then
ExitShort("sx2",AtStop,EntryPrice-PriceScale*X2);