커뮤니티

매수조건에서 매수되지 않고 더 높은 가격에서 매수가 됩니다

프로필 이미지
사과쥬스
2025-05-26 11:27:37
192
글번호 191161
답변완료

첨부 이미지

매수조건에서 매수되지 않고 더 높은 가격에서 매수가 됩니다 수식입니다 감사합니다 input : 금액(10000000),lowp(0), highp(0), nn(0) ,손절(0), 프로(99), 날짜(20240822), 저날짜(20250422),고가격(9999999999); var: PP(99999999999),count(0); if Bdate != Bdate[1] Then count = 0; if sDate > 날짜 Then if MarketPosition == 0 and Low <= highp and count == 0 Then buy("b1"); if MarketPosition == 1 Then{ if MaxEntries == 1 and Low <= (highp - lowp)*(9/nn)+lowp Then buy("b2"); if MaxEntries == 2 and Low <= (highp - lowp)*(8/nn)+lowp Then buy("b3"); if MaxEntries == 3 and Low <= (highp - lowp)*(7/nn)+lowp Then buy("b4"); if MaxEntries == 4 and Low <= (highp - lowp)*(6/nn)+lowp Then buy("b5"); if MaxEntries == 5 and Low <= (highp - lowp)*(5/nn)+lowp Then buy("b6"); if MaxEntries == 6 and Low <= (highp - lowp)*(4/nn)+lowp Then buy("b7"); if MaxEntries == 7 and Low <= (highp - lowp)*(3/nn)+lowp Then buy("b8"); if MaxEntries == 8 and Low <= (highp - lowp)*(2/nn)+lowp Then buy("b9"); if MaxEntries == 9 and Low <= (highp - lowp)*(1/nn)+lowp Then buy("b10"); } if sdate > 저날짜 and High >= (고가격-lowest(L,240))*0.27+lowest(L,240) Then ExitLong("BP",atlimit,h); count = count + 1; if Low < 손절 Then exitlong("BL"); count = count + 1;
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-05-26 15:42:45

안녕하세요 예스스탁입니다. if sdate > 저날짜 and High >= (고가격-lowest(L,240))*0.27+lowest(L,240) Then ExitLong("BP",atlimit,h); count = count + 1; if Low < 손절 Then exitlong("BL"); count = count + 1; 올리신 수식에서 count가 어떤 의미인지 모르겠습니다. 매봉 1씩 2번실행되어 2씩 증가합니다. 그러므로 첫봉에서 가격조건이 만족하지 않으면 count가 2가 되고 두번째 봉부터는 count==0이 아니므로 매수가 발생할 수 없습니다. count값이 각청산의 if문에 포함된 내용이면 {}로 묶으셔야 합니다. {}로 묶지 않으면 if문과 관련이 없이 매봉 증가하게 됩니다. if문 조건만족시 실행문이 2개 이상이면 항상 {}로 묶으셔야 합니다. input : 금액(10000000),lowp(0), highp(0), nn(0) ,손절(0), 프로(99), 날짜(20240822), 저날짜(20250422),고가격(9999999999); var: PP(99999999999),count(0); if Bdate != Bdate[1] Then count = 0; if sDate > 날짜 Then if MarketPosition == 0 and Low <= highp and count == 0 Then buy("b1"); if MarketPosition == 1 Then { if MaxEntries == 1 and Low <= (highp - lowp)*(9/nn)+lowp Then buy("b2"); if MaxEntries == 2 and Low <= (highp - lowp)*(8/nn)+lowp Then buy("b3"); if MaxEntries == 3 and Low <= (highp - lowp)*(7/nn)+lowp Then buy("b4"); if MaxEntries == 4 and Low <= (highp - lowp)*(6/nn)+lowp Then buy("b5"); if MaxEntries == 5 and Low <= (highp - lowp)*(5/nn)+lowp Then buy("b6"); if MaxEntries == 6 and Low <= (highp - lowp)*(4/nn)+lowp Then buy("b7"); if MaxEntries == 7 and Low <= (highp - lowp)*(3/nn)+lowp Then buy("b8"); if MaxEntries == 8 and Low <= (highp - lowp)*(2/nn)+lowp Then buy("b9"); if MaxEntries == 9 and Low <= (highp - lowp)*(1/nn)+lowp Then buy("b10"); } if MarketPosition == 1 and sdate > 저날짜 and High >= (고가격-lowest(L,240))*0.27+lowest(L,240) Then { ExitLong("BP",atlimit,h); count = count + 1; } if MarketPosition == 1 and Low < 손절 Then { exitlong("BL"); count = count + 1; } 즐거운 하루되세요 > 사과쥬스 님이 쓴 글입니다. > 제목 : 매수조건에서 매수되지 않고 더 높은 가격에서 매수가 됩니다 > 매수조건에서 매수되지 않고 더 높은 가격에서 매수가 됩니다 수식입니다 감사합니다 input : 금액(10000000),lowp(0), highp(0), nn(0) ,손절(0), 프로(99), 날짜(20240822), 저날짜(20250422),고가격(9999999999); var: PP(99999999999),count(0); if Bdate != Bdate[1] Then count = 0; if sDate > 날짜 Then if MarketPosition == 0 and Low <= highp and count == 0 Then buy("b1"); if MarketPosition == 1 Then{ if MaxEntries == 1 and Low <= (highp - lowp)*(9/nn)+lowp Then buy("b2"); if MaxEntries == 2 and Low <= (highp - lowp)*(8/nn)+lowp Then buy("b3"); if MaxEntries == 3 and Low <= (highp - lowp)*(7/nn)+lowp Then buy("b4"); if MaxEntries == 4 and Low <= (highp - lowp)*(6/nn)+lowp Then buy("b5"); if MaxEntries == 5 and Low <= (highp - lowp)*(5/nn)+lowp Then buy("b6"); if MaxEntries == 6 and Low <= (highp - lowp)*(4/nn)+lowp Then buy("b7"); if MaxEntries == 7 and Low <= (highp - lowp)*(3/nn)+lowp Then buy("b8"); if MaxEntries == 8 and Low <= (highp - lowp)*(2/nn)+lowp Then buy("b9"); if MaxEntries == 9 and Low <= (highp - lowp)*(1/nn)+lowp Then buy("b10"); } if sdate > 저날짜 and High >= (고가격-lowest(L,240))*0.27+lowest(L,240) Then ExitLong("BP",atlimit,h); count = count + 1; if Low < 손절 Then exitlong("BL"); count = count + 1;