커뮤니티
문의
2019-04-16 11:59:28
208
글번호 127872
아래 익절수식을 강제청산 함수로 바꾸어 주셨으면 합니다.
******************************************************************************
input : ntime(090000);
input : pyra(0.15);
input : 익절1(1.00),익절2(1.50),익절3(2.00),익절4(2.50),익절5(3.00);
if MarketPosition == 0 and
((sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime)) Then
buy("b1");
if MarketPosition == 1 Then
{
if MaxContracts == 1 Then
buy("b2",AtStop,LatestEntryPrice(0)+Pyra);
if MaxContracts == 2 Then
buy("b3",AtStop,LatestEntryPrice(0)+Pyra);
if MaxContracts == 3 Then
buy("b4",AtStop,LatestEntryPrice(0)+Pyra);
if MaxContracts == 4 Then
buy("b5",AtStop,LatestEntryPrice(0)+Pyra);
if MaxEntries == 5 then
{
ExitLong("bx1",atlimit,LatestEntryPrice(0)+익절1,"b5");
ExitLong("bx2",atlimit,LatestEntryPrice(0)+익절2,"b4");
ExitLong("bx3",atlimit,LatestEntryPrice(0)+익절3,"b3");
ExitLong("bx4",atlimit,LatestEntryPrice(0)+익절4,"b2");
ExitLong("bx5",atlimit,LatestEntryPrice(0)+익절5,"b1");
}
}
답변 1
예스스탁 예스스탁 답변
2019-04-16 16:17:30
안녕하세요
예스스탁입니다.
가능하지 않습니다.
강제청산함수는 피라미딩 진입신호별로 다른 값으로 셋팅이 되지 않습니다.
즐거운 하루되세요
> 목마와숙녀 님이 쓴 글입니다.
> 제목 : 문의
> 아래 익절수식을 강제청산 함수로 바꾸어 주셨으면 합니다.
******************************************************************************
input : ntime(090000);
input : pyra(0.15);
input : 익절1(1.00),익절2(1.50),익절3(2.00),익절4(2.50),익절5(3.00);
if MarketPosition == 0 and
((sdate != sdate[1] and stime >= ntime) or
(sdate == sdate[1] and stime >= ntime and stime[1] < ntime)) Then
buy("b1");
if MarketPosition == 1 Then
{
if MaxContracts == 1 Then
buy("b2",AtStop,LatestEntryPrice(0)+Pyra);
if MaxContracts == 2 Then
buy("b3",AtStop,LatestEntryPrice(0)+Pyra);
if MaxContracts == 3 Then
buy("b4",AtStop,LatestEntryPrice(0)+Pyra);
if MaxContracts == 4 Then
buy("b5",AtStop,LatestEntryPrice(0)+Pyra);
if MaxEntries == 5 then
{
ExitLong("bx1",atlimit,LatestEntryPrice(0)+익절1,"b5");
ExitLong("bx2",atlimit,LatestEntryPrice(0)+익절2,"b4");
ExitLong("bx3",atlimit,LatestEntryPrice(0)+익절3,"b3");
ExitLong("bx4",atlimit,LatestEntryPrice(0)+익절4,"b2");
ExitLong("bx5",atlimit,LatestEntryPrice(0)+익절5,"b1");
}
}
다음글
이전글