답변완료
진입가에 청산
아래수식은 보내주신 진입가 청산수식인데 ..
기본적으로 진입이 처음한번만 하고 다음 진입이 없읍니다.
조정틱 0 으로 해도 마찬가지...
부탁드립니다.
//----------------------------------------------------------
nput : P1(20),P2(60),조정틱(5),감시틱수(22);
var : mav1(0),mav2(0),T(0),B(0),S(0);
mav1 = ma(C,P1);
mav2 = ma(C,P2);
if CrossUp(mav1,mav2) Then
{
T = 1;
B = C;
}
if CrossDown(mav1,mav2) Then
{
T = -1;
S = C;
}
if T == 1 and S > 0 Then
Buy("b",AtStop,S+PriceScale*조정틱);
if T == -1 Then
Sell("S",AtStop,S-PriceScale*조정틱);
if MarketPosition == 1 Then
{
B = 0;
if highest(H,BarsSinceEntry) >= EntryPrice+감시틱수 Then
ExitLong("bx",AtStop,EntryPrice);
}
if MarketPosition == -1 Then
{
S = 0;
if Lowest(L,BarsSinceEntry) <= EntryPrice-감시틱수 Then
ExitShort("sx",AtStop,EntryPrice);
}
2023-05-08
1458
글번호 168798
시스템