매수 청산 수식인데요 onclose 와 atlimit는 현재가 청산
atstop은 시장가 청산으로 셋팅하려고 합니다.
그런데 마지막으로 주말 청산하는 수식도 onclose 또는 atlimit로 구분하고 싶은데
어떻게 해야할지 모르겠습니다.
----------------------------------------------
if bdate != bdate[1] Then
SetStopEndofday(0);
if sdate != sdate[1] and DayOfWeek(sdate) == 6 Then
SetStopEndofday(060000);
--------------------------------------------------
이수식을 수정 부탁드림니다.
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산",OnClose);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1",OnClose);
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3);
Else
{
if L <= EntryPrice-PriceScale*즉시손절1 Then
ExitLong("즉시손절1",AtStop,L-PriceScale*저점손절틱수);
}
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then
ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1*N4 and C < O Then
ExitLong("저점에서 올라와서 본전 청산",atlimit,EntryPrice+PriceScale*본전생각틱);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1 *N5 and CCIv >= CCI값1 and C < O Then
ExitLong("저점에서 올라와서 약손절",OnClose);
if CrossDown(c,bbup) and C < O Then
ExitLong("볼밴청산",OnClose);
}
if bdate != bdate[1] Then
SetStopEndofday(0);
if sdate != sdate[1] and DayOfWeek(sdate) == 6 Then
SetStopEndofday(060000);
답변 1
예스스탁
예스스탁 답변
2020-03-03 11:43:54
안녕하세요
예스스탁입니다.
SetStopEndofday은 가격을 감시하는 부분이 아니므로 신호가 발생하면
Onclose타입으로 분류가 됩니다.
1. onclose
if DayOfWeek(sdate) == 6 and
((NextBarSdate != sdate and NextBarStime >= 060000) or
(NextBarSdate == sdate and NextBarStime >= 060000 and stime < 060000)) Then
{
ExitLong("bx");
ExitShort("sx");
}
2
atlimit은 가격을 비교해서 신호가 발생여부가 결정되는 타입인데
시간청산에서 사용하면 지정할 가격이 애매합니다.
가격을 잘못지정하면 가격조건때문에 신호가 발생하지 않을수 있습니다.
지정한 시간이 충족되면 무조건 신호가 발생하게
매수청산은 0이상
매도청산은 9999999999이하로 지정했습니다.
if DayOfWeek(sdate) == 6 and
((NextBarSdate != sdate and NextBarStime >= 150000) or
(NextBarSdate == sdate and NextBarStime >= 150000 and stime < 150000)) Then
{
ExitLong("bx",atlimit,0);
ExitShort("sx",atlimit,9999999999);
}
즐거운 하루되세요
> 이형지 님이 쓴 글입니다.
> 제목 : 주말 일괄 청산 수식 부탁드림니다.
> 매수 청산 수식인데요 onclose 와 atlimit는 현재가 청산
atstop은 시장가 청산으로 셋팅하려고 합니다.
그런데 마지막으로 주말 청산하는 수식도 onclose 또는 atlimit로 구분하고 싶은데
어떻게 해야할지 모르겠습니다.
----------------------------------------------
if bdate != bdate[1] Then
SetStopEndofday(0);
if sdate != sdate[1] and DayOfWeek(sdate) == 6 Then
SetStopEndofday(060000);
--------------------------------------------------
이수식을 수정 부탁드림니다.
if MarketPosition == 1 then
{
BuySetup = false;
if countif(CrossDown(CCIv,CCI값),BarsSinceEntry) >= 1 and
CCIv < CCI값 and C < O Then
ExitLong("매수cci청산",OnClose);
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*즉시익절1 and C < O Then
ExitLong("즉시익절1",OnClose);
if highest(H,BarsSinceEntry) >= (EntryPrice+PriceScale*즉시익절1*N2) Then
ExitLong("본전청산1",AtStop,EntryPrice+PriceScale*즉시익절1*N3);
Else
{
if L <= EntryPrice-PriceScale*즉시손절1 Then
ExitLong("즉시손절1",AtStop,L-PriceScale*저점손절틱수);
}
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*tr수익 Then
ExitLong("tr",AtStop, highest(H,BarsSinceEntry)-PriceScale*tr하락);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1*N4 and C < O Then
ExitLong("저점에서 올라와서 본전 청산",atlimit,EntryPrice+PriceScale*본전생각틱);
if lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*즉시손절1 *N5 and CCIv >= CCI값1 and C < O Then
ExitLong("저점에서 올라와서 약손절",OnClose);
if CrossDown(c,bbup) and C < O Then
ExitLong("볼밴청산",OnClose);
}
if bdate != bdate[1] Then
SetStopEndofday(0);
if sdate != sdate[1] and DayOfWeek(sdate) == 6 Then
SetStopEndofday(060000);