커뮤니티

매수매도 수식

프로필 이미지
바나
2021-03-17 02:53:38
886
글번호 147156
답변완료
주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}
시스템
답변 6
프로필 이미지

예스스탁 예스스탁 답변

2021-03-17 15:18:07

안녕하세요 예스스탁입니다. {}작성가 잘못 지정이 되어 있습니다. 아래 수정한 식입니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 매수매도 수식 > 주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}
프로필 이미지

바나

2021-03-17 15:23:25

매도에 관한 수식도 좀 부탁 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. {}작성가 잘못 지정이 되어 있습니다. 아래 수정한 식입니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 매수매도 수식 > 주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}
프로필 이미지

예스스탁 예스스탁 답변

2021-03-17 15:48:38

안녕하세요 예스스탁입니다. 매도식 추가했습니다. 날자시간 설정이나 금액은 작성하신 내용으로 사용하시면 됩니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } if condition1 == false and crossup(value,S7Percent) then { condition1 = true; exitlong("bx1",onclose,def,"",floor(maxcontracts*0.2),1); } if condition2 == true and crossup(value,S8Percent) then { condition2 = true; exitlong("bx2",onclose,def,"",floor(maxcontracts*0.4),1); } if condition3 == true and crossup(value,S9Percent) then { condition3 = true; exitlong("bx3"); } if crossdown(value,S7Percent) then exitlong("bx"); } else { condition1 = false; condition2 = false; condition3 = false; condition4 = false; } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : Re : Re : 매수매도 수식 > 매도에 관한 수식도 좀 부탁 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. {}작성가 잘못 지정이 되어 있습니다. 아래 수정한 식입니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 매수매도 수식 > 주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}
프로필 이미지

바나

2021-03-17 15:54:06

너무 감사드립니다 ㅠ 하나만 더 질문 드릴께요. 프로그램 돌려보니까 올 매도후에 다시 재진입을 하지 않던데 이건 제가 다시 날짜라던지 재설정해야 하는 부분인지요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. 매도식 추가했습니다. 날자시간 설정이나 금액은 작성하신 내용으로 사용하시면 됩니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } if condition1 == false and crossup(value,S7Percent) then { condition1 = true; exitlong("bx1",onclose,def,"",floor(maxcontracts*0.2),1); } if condition2 == true and crossup(value,S8Percent) then { condition2 = true; exitlong("bx2",onclose,def,"",floor(maxcontracts*0.4),1); } if condition3 == true and crossup(value,S9Percent) then { condition3 = true; exitlong("bx3"); } if crossdown(value,S7Percent) then exitlong("bx"); } else { condition1 = false; condition2 = false; condition3 = false; condition4 = false; } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : Re : Re : 매수매도 수식 > 매도에 관한 수식도 좀 부탁 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. {}작성가 잘못 지정이 되어 있습니다. 아래 수정한 식입니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 매수매도 수식 > 주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}
프로필 이미지

예스스탁 예스스탁 답변

2021-03-17 16:19:04

안녕하세요 예스스탁입니다. 작성하신 수식이 지정한 날짜와 시간이후에 1회만 진입되게 작성이 되어 있습니다. 외부변수 N이 1이고 count < N으로 첫진입조건이 되어 있습니다. 지정한 날짜와 시간이후에 별도의 횟수제한이 없으시면 "b1"진입에 count < N 조건을 삭제하시면 되고 몇회로 제한하고자 하시면 N값을 늘리시면 됩니다. 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : Re : Re : Re : Re : 매수매도 수식 > 너무 감사드립니다 ㅠ 하나만 더 질문 드릴께요. 프로그램 돌려보니까 올 매도후에 다시 재진입을 하지 않던데 이건 제가 다시 날짜라던지 재설정해야 하는 부분인지요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. 매도식 추가했습니다. 날자시간 설정이나 금액은 작성하신 내용으로 사용하시면 됩니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } if condition1 == false and crossup(value,S7Percent) then { condition1 = true; exitlong("bx1",onclose,def,"",floor(maxcontracts*0.2),1); } if condition2 == true and crossup(value,S8Percent) then { condition2 = true; exitlong("bx2",onclose,def,"",floor(maxcontracts*0.4),1); } if condition3 == true and crossup(value,S9Percent) then { condition3 = true; exitlong("bx3"); } if crossdown(value,S7Percent) then exitlong("bx"); } else { condition1 = false; condition2 = false; condition3 = false; condition4 = false; } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : Re : Re : 매수매도 수식 > 매도에 관한 수식도 좀 부탁 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. {}작성가 잘못 지정이 되어 있습니다. 아래 수정한 식입니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 매수매도 수식 > 주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}
프로필 이미지

바나

2021-03-17 16:37:13

자꾸 질문드려서 정말 죄송합니다. count < N 조건을 삭제하고 났더니 처음 1회차 2회차 매수 되다가 매도 신호와서 올매도 된 이후에 다시 진입은 하지만 다시 1회차 2회차 시작하는게 아니고 3회차 4회차 매수로 넘어가던데 이부분은 어떻게 하면 되는지요.. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : Re : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. 작성하신 수식이 지정한 날짜와 시간이후에 1회만 진입되게 작성이 되어 있습니다. 외부변수 N이 1이고 count < N으로 첫진입조건이 되어 있습니다. 지정한 날짜와 시간이후에 별도의 횟수제한이 없으시면 "b1"진입에 count < N 조건을 삭제하시면 되고 몇회로 제한하고자 하시면 N값을 늘리시면 됩니다. 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : Re : Re : Re : Re : 매수매도 수식 > 너무 감사드립니다 ㅠ 하나만 더 질문 드릴께요. 프로그램 돌려보니까 올 매도후에 다시 재진입을 하지 않던데 이건 제가 다시 날짜라던지 재설정해야 하는 부분인지요? > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. 매도식 추가했습니다. 날자시간 설정이나 금액은 작성하신 내용으로 사용하시면 됩니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } if condition1 == false and crossup(value,S7Percent) then { condition1 = true; exitlong("bx1",onclose,def,"",floor(maxcontracts*0.2),1); } if condition2 == true and crossup(value,S8Percent) then { condition2 = true; exitlong("bx2",onclose,def,"",floor(maxcontracts*0.4),1); } if condition3 == true and crossup(value,S9Percent) then { condition3 = true; exitlong("bx3"); } if crossdown(value,S7Percent) then exitlong("bx"); } else { condition1 = false; condition2 = false; condition3 = false; condition4 = false; } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : Re : Re : 매수매도 수식 > 매도에 관한 수식도 좀 부탁 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 매수매도 수식 > 안녕하세요 예스스탁입니다. {}작성가 잘못 지정이 되어 있습니다. 아래 수정한 식입니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then { #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then { if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { buy("b5",onclose,def,vv[MaxEntries]); } } } 즐거운 하루되세요 > 바나 님이 쓴 글입니다. > 제목 : 매수매도 수식 > 주식에서 사용하던 수식을 수정해서 예스트레이더 코인에 적요하고 싶은데 아무리해도 잘 모르겠습니다. 1.RSI(30%)하락이 나올때마다 매수진행(RSI를 새로 뚫을때마다 매수) 2.RSI(70%)도달시 1/5 매도, RSI(80%)도달시 2/5 매도, RSI(90%)도달시 2/5 매도, RSI(70%)를 다시 벗어날경우 올매도 하는 식 삽입을 원합니다. 3.수식을 작성해보았으나, 2번매수밖에 진행이 되지 않음. (분할 5번으로 설정하였음) 4.코인거래는 주식처럼 장의 시작과 끝의 개념이 없는데 원하는 시간대부터 시작하고 싶을때는 작성한 수식대로 하면 되는 것인지 궁금하고 주식과 같이 투자금액으로 밑에 식처럼 설정하면 되는 것인지 궁금합니다. Input : 투자금액(1000000),Period(14), N(1), LPercent(30), S7Percent(70), S8Percent(80), S9Percent(90),시작일(20210315),시작시간(090000); var : value(0), e(0),x(0),count(0),Vma(0), Tcond(false); var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); Array : VV[5](0),XX[5](0); value = RSI(Period); vv[0] = floor((투자금액*0.1)/NextBarOpen); vv[1] = floor((투자금액*0.1)/NextBarOpen); vv[2] = floor((투자금액*0.1)/NextBarOpen); vv[3] = floor((투자금액*0.2)/NextBarOpen); vv[4] = floor((투자금액*0.2)/NextBarOpen); vv[5] = floor((투자금액*0.3)/NextBarOpen); if NextBarSdate >= 시작일 and NextBarStime >= 시작시간 Then Tcond = true; if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then count = count+1; if sdate >= 시작일 and stime >= 시작시간 Then Tcond = true; if Tcond == true then{ #첫번째 매수 if (TotalTrades == 0 or MarketPosition == 0) then{ if MarketPosition == 0 and count < N and CrossDown(value, LPercent) Then { buy("b1",onclose,def,vv[MaxEntries]); } if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then{ e = e +1; if e == 0 then XX[e] = CurrentContracts; Else XX[e] = CurrentContracts-CurrentContracts[1]; } #두번째 매수 If MarketPosition == 1 and e == 1 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b2",onclose,def,vv[MaxEntries]); } #세번재매수 If MarketPosition == 1 and e == 2 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b3",onclose,def,vv[MaxEntries]); } #네번재매수 If MarketPosition == 1 and e == 3 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b4",onclose,def,vv[MaxEntries]); } #다섯번재매수 If MarketPosition == 1 and e == 4 and CrossDown(value, LPercent) and NextBarSdate == sdate Then { { buy("b5",onclose,def,vv[MaxEntries]); } }}}}}}}