커뮤니티
수식추가
2019-02-15 13:55:48
162
글번호 126228
아래는 buy수식이며 2회 거래합니다.
1회차 거래에서 피라미딩을 하고
2회차 거래에서도 피라미딩을 할 수 있는 수식을 추가해주시기 바랍니다.
input : 피라미딩수량(5),피라미딩포인트(0.25)
if MarketPosition == 1 and MaxContracts < 피라미딩수량 Then
buy("bb",AtStop,LatestEntryPrice(0)+피라미딩포인트);
위의 피라미딩수식을 수식끝에 적용했는데 2회 거래는 하지 않는 경우가 발생하였습니다.
수식하단이 아니라 1차진입 수식과 2차진입 수식에 피라미딩수식을 각각 추가해주셨으면 합니다.
**********************************************************************************
buy 수식
input : b1(20),b2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+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);
답변 1
예스스탁 예스스탁 답변
2019-02-15 16:24:20
안녕하세요
예스스탁입니다.
totaltrade는 전체 진입횟수입니다.
피라미딩을 하면 추가로 진입하므로 피라미딩 추가진입도 전체 진입횟수에 포함됩니다.
아래와 같이 진입회수 카운트를 다르게 작성하셔야 합니다.
input : b1(20),b2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(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);
input : 피라미딩수량(5),피라미딩포인트(0.25);
if MarketPosition == 1 and MaxContracts < 피라미딩수량 and MaxEntries == 1 Then
buy("bb",AtStop,LatestEntryPrice(0)+피라미딩포인트);
즐거운 하루되세요
> 좌오비우오비 님이 쓴 글입니다.
> 제목 : 수식추가
> 아래는 buy수식이며 2회 거래합니다.
1회차 거래에서 피라미딩을 하고
2회차 거래에서도 피라미딩을 할 수 있는 수식을 추가해주시기 바랍니다.
input : 피라미딩수량(5),피라미딩포인트(0.25)
if MarketPosition == 1 and MaxContracts < 피라미딩수량 Then
buy("bb",AtStop,LatestEntryPrice(0)+피라미딩포인트);
위의 피라미딩수식을 수식끝에 적용했는데 2회 거래는 하지 않는 경우가 발생하였습니다.
수식하단이 아니라 1차진입 수식과 2차진입 수식에 피라미딩수식을 각각 추가해주셨으면 합니다.
**********************************************************************************
buy 수식
input : b1(20),b2(20),X1(20),X2(20),진입시간(090000);
var : T1(0),entry(0),LL(0),EH(0);
if Bdate != Bdate[1] Then
T1 = TotalTrades;
if MarketPosition == 0 Then
entry = TotalTrades-T1;
Else
entry = (TotalTrades-T1)+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);