커뮤니티

매도할때 매수명을 다양하게 사용하는 방법문의

프로필 이미지
포에니
2022-11-04 16:09:22
826
글번호 163533
답변완료
먼저 많은 도움이 되고있어 감사드립니다. 피라미딩 분할매수중인데.. 5회 매수할때.. 각 회수별 매수에서.. 조건이 각각 4가지가 있는데... 그 각 조건마다 매수이름이 다릅니다. 예를들어, 2회차 매수조건이 if (A조건) then buy("b21",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); Else if (B조건) then buy("b22",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); Else if (C조건) then buy("b23",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); Else if (D조건) then buy("b24",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); 이렇게. 회수별 조건이 각 4개씩 세부적으로 주어진후 매수시.. 2번째 추가매수는 위 4가지중 1가지가 됩니다. 그러면..청산시.. 위 매수이름을(또는 수량을)그대로 받아서 청산하는 수식을 알고싶어요 위에서 매수한 Entryname을 그대로 청산하는 수식.. 매도식은.. if MarketPosition == 1 and MaxEntries==1 and highest(l,BarsSinceEntry) >= avgEntryPrice*1.015 Then ExitLong("청산",Atlimit,AvgEntryPrice*1.0125, "ㅁㅁㅁㅁㅁ"); ㅁㅁㅁㅁ에 매수이름을 ...다양하게 넣울수 없는가요?? 매수명마다 청산식을 4가지 다 따로따로 만들어줘야하는지.. 하나의 식으로 할수없는지.. if MarketPosition == 1 and MaxEntries==1 and highest(l,BarsSinceEntry) >= avgEntryPrice*1.015 Then ExitLong("청산",Atlimit,AvgEntryPrice*1.0125, "b21" or "b22" or "b23" "b24""); 이렇게하니 에러나네요..ㅠㅠ
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2022-11-04 16:43:47

안녕하세요 예스스탁입니다. 각 신호함수의 이름은 고정으로 사용하게 되어 있어 변수처리나 함수로 지정하거나 or로 처리가 되지 않습니다. 진입명별로 각각 작성해 주셔야 합니다. 도움을 드리지 못해 죄송합니다. 즐거운 하루되세요 > 포에니 님이 쓴 글입니다. > 제목 : 매도할때 매수명을 다양하게 사용하는 방법문의 > 먼저 많은 도움이 되고있어 감사드립니다. 피라미딩 분할매수중인데.. 5회 매수할때.. 각 회수별 매수에서.. 조건이 각각 4가지가 있는데... 그 각 조건마다 매수이름이 다릅니다. 예를들어, 2회차 매수조건이 if (A조건) then buy("b21",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); Else if (B조건) then buy("b22",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); Else if (C조건) then buy("b23",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); Else if (D조건) then buy("b24",atlimit,LatestEntryPrice(0)*0.96,Floor((투자금액*0.20)/min(NextBarOpen,LatestEntryPrice(0)*0.98))); 이렇게. 회수별 조건이 각 4개씩 세부적으로 주어진후 매수시.. 2번째 추가매수는 위 4가지중 1가지가 됩니다. 그러면..청산시.. 위 매수이름을(또는 수량을)그대로 받아서 청산하는 수식을 알고싶어요 위에서 매수한 Entryname을 그대로 청산하는 수식.. 매도식은.. if MarketPosition == 1 and MaxEntries==1 and highest(l,BarsSinceEntry) >= avgEntryPrice*1.015 Then ExitLong("청산",Atlimit,AvgEntryPrice*1.0125, "ㅁㅁㅁㅁㅁ"); ㅁㅁㅁㅁ에 매수이름을 ...다양하게 넣울수 없는가요?? 매수명마다 청산식을 4가지 다 따로따로 만들어줘야하는지.. 하나의 식으로 할수없는지.. if MarketPosition == 1 and MaxEntries==1 and highest(l,BarsSinceEntry) >= avgEntryPrice*1.015 Then ExitLong("청산",Atlimit,AvgEntryPrice*1.0125, "b21" or "b22" or "b23" "b24""); 이렇게하니 에러나네요..ㅠㅠ