예스스탁
예스스탁 답변
2020-02-17 13:31:56
안녕하세요
예스스탁입니다.
input : a(1.5),k(5),익절(3);
var : cond(0),sump(0),sumv(0),T(0),ap(0),lp(0);
if MarketPosition <= 0 and cond >= 2 and cond[1] < 2 Then
buy("b",OnClose,def,1);
if MarketPosition == 1 then
{
if CurrentContracts == 1 Then
{
sump = 0;
sumv = 0;
}
if CurrentContracts > CurrentContracts[1] and CurrentContracts >= 2 Then
{
sump = sump + LatestEntryPrice(0)*(CurrentContracts-CurrentContracts[1]);
sumv = sumv + (CurrentContracts-CurrentContracts[1]);
ap = sump/sumv;
}
if CurrentContracts > CurrentContracts[1] Then
{
T = 1;
LP = LatestEntryPrice(0);
}
if CurrentContracts < CurrentContracts[1] Then
{
T = -1;
LP = H;
}
if T == -1 and H > LP Then
LP = H;
if c <= LP*(1-a/100) and MaxEntries < k+1 Then
buy("bb",OnClose,def,1);
if CurrentContracts >= 2 then
{
ExitLong("bx",atlimit,ap*(1+익절/100),"bb");
}
}
if MarketPosition >= 0 and cond <= -2 and cond[1] > -2 Then
sell("s",OnClose,def,1);
if MarketPosition == -1 then
{
if CurrentContracts == 1 Then
{
sump = 0;
sumv = 0;
}
if CurrentContracts > CurrentContracts[1] and CurrentContracts >= 2 Then
{
sump = sump + LatestEntryPrice(0)*(CurrentContracts-CurrentContracts[1]);
sumv = sumv + (CurrentContracts-CurrentContracts[1]);
ap = sump/sumv;
}
if CurrentContracts > CurrentContracts[1] Then
{
T = 1;
LP = LatestEntryPrice(0);
}
if CurrentContracts < CurrentContracts[1] Then
{
T = -1;
LP = L;
}
if T == -1 and L < LP Then
LP = L;
if c >= LP*(1+a/100) and MaxEntries < k+1 Then
sell("ss",OnClose,def,1);
if CurrentContracts >= 2 then
{
ExitShort("sx",atlimit,ap*(1-익절/100),"ss");
}
}
즐거운 하루되세요
> 에구머니 님이 쓴 글입니다.
> 제목 : 수식 문의
> 안녕하세요?
시스템 수식 부탁드립니다.
감사합니다.