커뮤니티
함수 추가 부탁드립니다.
2019-07-04 10:41:52
247
글번호 130038
안녕하세요.
아래 수식을 14:00 이전에는 하루에 한방향으로는 한번만 진입할 수 있도록 함수 추가 부탁드립니다.
(즉, 하루에 매수로 1번만 진입 청산, 매도로 1번만 진입 청산 가능)
감사합니다.
input : p1(80), p2(20), p3(70), stoRange(20), chnnel(2);
var : stoK(0), stoD(0), osill(0);
stoK = StochasticsK(p1,p2);
stoD = StochasticsD(p1,p2,p3);
osill = stoK-stoD;
if CrossUp(stoK, stoD) Then buy();
if CrossDown(stoK, stoD) Then sell();
if stoK > stoD && osill < stoRange && accumN(iff(osill>osill[2],1,1),3)== 3 Then
buy();
if stoK < stoD && osill > -stoRange && accumN(iff(osill<osill[2],1,1),3)== 3 Then
sell();
if stoK > stoD && C > dayOpen(1) + Chnnel Then
buy();
if stoK < stoD && C < dayOpen(1) - Chnnel Then
sell();
답변 1
예스스탁 예스스탁 답변
2019-07-04 11:29:34
안녕하세요
예스스탁입니다.
input : p1(80), p2(20), p3(70), stoRange(20), chnnel(2);
var : stoK(0), stoD(0), osill(0);
var : Bcnt(0),Scnt(0);
if bdate != bdate[1] Then
{
Bcnt = 0;
Scnt = 0;
}
if MarketPosition == 1 and MarketPosition != MarketPosition[1] Then
Bcnt = Bcnt+1;
if MarketPosition == -1 and MarketPosition != MarketPosition[1] Then
Scnt = Scnt+1;
stoK = StochasticsK(p1,p2);
stoD = StochasticsD(p1,p2,p3);
osill = stoK-stoD;
if Bcnt < 1 and stime < 140000 and CrossUp(stoK, stoD) Then buy();
if Scnt < 1 and stime < 140000 and CrossDown(stoK, stoD) Then sell();
if Bcnt < 1 and stime < 140000 and stoK > stoD && osill < stoRange && accumN(iff(osill>osill[2],1,1),3)== 3 Then
buy();
if Scnt < 1 and stime < 140000 and stoK < stoD && osill > -stoRange && accumN(iff(osill<osill[2],1,1),3)== 3 Then
sell();
if Bcnt < 1 and stime < 140000 and stoK > stoD && C > dayOpen(1) + Chnnel Then
buy();
if Scnt < 1 and stime < 140000 and stoK < stoD && C < dayOpen(1) - Chnnel Then
sell();
즐거운 하루되세요
> 바둑이 님이 쓴 글입니다.
> 제목 : 함수 추가 부탁드립니다.
> 안녕하세요.
아래 수식을 14:00 이전에는 하루에 한방향으로는 한번만 진입할 수 있도록 함수 추가 부탁드립니다.
(즉, 하루에 매수로 1번만 진입 청산, 매도로 1번만 진입 청산 가능)
감사합니다.
input : p1(80), p2(20), p3(70), stoRange(20), chnnel(2);
var : stoK(0), stoD(0), osill(0);
stoK = StochasticsK(p1,p2);
stoD = StochasticsD(p1,p2,p3);
osill = stoK-stoD;
if CrossUp(stoK, stoD) Then buy();
if CrossDown(stoK, stoD) Then sell();
if stoK > stoD && osill < stoRange && accumN(iff(osill>osill[2],1,1),3)== 3 Then
buy();
if stoK < stoD && osill > -stoRange && accumN(iff(osill<osill[2],1,1),3)== 3 Then
sell();
if stoK > stoD && C > dayOpen(1) + Chnnel Then
buy();
if stoK < stoD && C < dayOpen(1) - Chnnel Then
sell();
다음글
이전글