커뮤니티

수식 변경 부탁드립니다.

프로필 이미지
쌀사비팔
2010-03-10 13:22:36
592
글번호 28587
답변완료
<현물, 분봉> 아래 식을 변경 부탁드립니다. * 당일 10시에 무조건 청산하는 식인데요.. - “당일 10시에 상한가이면 청산하지 않고, 익일 시가에 청산” - “당일 10시에 상한가가 아니면 청산” 으로 변경 부탁드립니다. 감사합니다. -------------------------------- input : 전일날짜(20100308); if stime == 150000 then{ if sDate == 전일날짜 and NextBarOpen >= C*1.015 and NextBarOpen <= C*1.05 Then buy("b1",AtMarket); if sDate == 전일날짜 and NextBarOpen <= C*0.96 and NextBarOpen >= C*0.91 Then buy("b2",AtMarket); } SetStopEndofday(100000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2010-03-10 14:08:06

안녕하세요 예스스탁입니다. input : 전일날짜(20100308); var : 상한가(0), UpLimit(0); var : aaa(0), bbb(0), ccc(0), ddd(0), eee(0),fff(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else UpLimit = (BP[0] * 1.15); if CodeCategory() == 2 then { if date >= 20030721 then { aaa = int(UpLimit/100+0.00001)*100; bbb = int(UpLimit/100+0.00001)*100; ccc = int(UpLimit/100+0.00001)*100; ddd = int(UpLimit/50+0.00001)*50; eee = int(UpLimit/10+0.00001)*10; fff = int(UpLimit/5+0.00001)*5; } else { aaa = int(UpLimit/1000+0.00001)*1000; bbb = int(UpLimit/500+0.00001)*500; ccc = int(UpLimit/100+0.00001)*100; ddd = int(UpLimit/50+0.00001)*50; eee = int(UpLimit/10+0.00001)*10; fff = int(UpLimit/10+0.00001)*10; } } Else { aaa = int(UpLimit/1000+0.00001)*1000; bbb = int(UpLimit/500+0.00001)*500; ccc = int(UpLimit/100+0.00001)*100; ddd = int(UpLimit/50+0.00001)*50; eee = int(UpLimit/10+0.00001)*10; fff = int(UpLimit/5+0.00001)*5; } if CodeCategory() == 1 || CodeCategory() == 2 then { If BP >= 500000 Then 상한가 = aaa; Else If BP >= 100000 Then 상한가 = iff(bbb>=500000, aaa, bbb); Else If BP >= 50000 Then 상한가 = iff(ccc>=100000, bbb, ccc); Else If BP >= 10000 Then 상한가 = iff(ddd>=50000, ccc, ddd); Else If BP >= 5000 Then 상한가 = iff(eee>=10000, ddd, eee); Else 상한가 = iff(fff>=5000, eee, fff); } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = fff; } } if stime == 150000 then{ if sDate == 전일날짜 and NextBarOpen >= C*1.015 and NextBarOpen <= C*1.05 Then buy("b1",AtMarket); if sDate == 전일날짜 and NextBarOpen <= C*0.96 and NextBarOpen >= C*0.91 Then buy("b2",AtMarket); } if dayhigh <= 상한가 Then SetStopEndofday(100000); Else SetStopEndofday(0); if MarketPosition == 1 and stime == 150000 Then exitlong("bx",AtMarket); 즐거운 하루되세요 > 쌀사비팔 님이 쓴 글입니다. > 제목 : 수식 변경 부탁드립니다. > <현물, 분봉> 아래 식을 변경 부탁드립니다. * 당일 10시에 무조건 청산하는 식인데요.. - “당일 10시에 상한가이면 청산하지 않고, 익일 시가에 청산” - “당일 10시에 상한가가 아니면 청산” 으로 변경 부탁드립니다. 감사합니다. -------------------------------- input : 전일날짜(20100308); if stime == 150000 then{ if sDate == 전일날짜 and NextBarOpen >= C*1.015 and NextBarOpen <= C*1.05 Then buy("b1",AtMarket); if sDate == 전일날짜 and NextBarOpen <= C*0.96 and NextBarOpen >= C*0.91 Then buy("b2",AtMarket); } SetStopEndofday(100000);