커뮤니티
64491질문자입니다.~한가지 식만 더 부탁드립니다. 죄송합니다.
2019-10-14 11:30:42
132
글번호 132764
input : Period11(1),Period12(2),Period13(3);
input : Period21(4),Period22(5),Period23(6);
input : Period31(7),Period32(8),Period33(9);
Input : Period(20), MultiD(2);
var : SMI1(0),SMI2(0),SMI3(0),Bcond(false),Scond(false);
var : BBmd(0),BBup(0),BBdn(0),T(0);
SMI1 = SMI(Period11,Period12,Period13);
SMI2 = SMI(Period21,Period22,Period23);
SMI3 = SMI(Period31,Period32,Period33);
BBmd = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
Bcond = SMI1 > SMI2 and SMI2 > SMI3 and SMI3 ;
SMI1 = SMI(Period11,Period12,Period13);
SMI2 = SMI(Period21,Period22,Period23);
SMI3 = SMI(Period31,Period32,Period33);
Scond = SMI1 < SMI2 and SMI2 < SMI3 and SMI3;
if MarketPosition <= 0 then
{
if Bcond == true and Bcond[1] == false Then
{
T = 1;
}
if T == 1 and Bcond == true Then
buy("b",atlimit,BBdn);
}
if MarketPosition >= 0 then
{
if Scond == true and Scond[1] == false Then
{
T = -1;
}
if T == -1 and Scond == true then
sell("s",Atlimit,BBup);
}
if MarketPosition == 1 then
{
exitlong("bx",atlimit,bbup);
}
if MarketPosition == -1 then
{
ExitShort("sx",atlimit,bbdn);
}
위 식에서 조건을 하나만 더 달고 싶습니다.
input : Period11(1),Period12(2),Period13(3);
input : Period21(4),Period22(5),Period23(6);
input : Period31(7),Period32(8),Period33(9);
에서
input : Period11(10),Period12(11),Period13(12);
input : Period21(13),Period22(14),Period23(15);
input : Period31(16),Period32(17),Period33(18);
input : Period31(19),Period32(20),Period33(21);
SMI4 = SMI(Period41,Period42,Period43);
SMI5 = SMI(Period51,Period52,Period53);
SMI6 = SMI(Period61,Period62,Period63);
SMI7 = SMI(Period71,Period72,Period73);
Bcond = SMI4 > SMI5 and SMI5 > SMI6 and SMI6 > smi7 ;
Scond = SMI4 < SMI5 and SMI6 < SMI6 and SMI6 < smi7 ;
스톡으로 4개의 선을 더 만들어서 조건에 추가 싶으고 싶습니다. 위와 같이 4개의 선이 정배열일때 제일 위에 조건식이 맞으면 매수 진입 역배열이면 매도 진입 입니다.
부탁드립니다.~~~ps 제가 추가 하고 싶은 4개의 선은 위의 smi1 smi2 smi3와는 별개의 조건입니다.
답변 1
예스스탁 예스스탁 답변
2019-10-15 09:21:06
안녕하세요
예스스탁입니다.
input : Period11(1),Period12(2),Period13(3);
input : Period21(4),Period22(5),Period23(6);
input : Period31(7),Period32(8),Period33(9);
input : Period41(10),Period42(11),Period43(12);
input : Period51(13),Period52(14),Period53(15);
input : Period61(16),Period62(17),Period63(18);
input : Period71(19),Period72(20),Period73(21);
Input : Period(20), MultiD(2);
var : SMI1(0),SMI2(0),SMI3(0);
var : Bcond1(false),Scond1(false);
var : SMI4(0),SMI5(0),SMI6(0),SMI7(0);
var : Bcond2(false),Scond2(false);
var : BBmd(0),BBup(0),BBdn(0),T(0);
SMI1 = SMI(Period11,Period12,Period13);
SMI2 = SMI(Period21,Period22,Period23);
SMI3 = SMI(Period31,Period32,Period33);
SMI4 = SMI(Period41,Period42,Period43);
SMI5 = SMI(Period51,Period52,Period53);
SMI6 = SMI(Period61,Period62,Period63);
SMI7 = SMI(Period71,Period72,Period73);
BBmd = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
Bcond1 = SMI1 > SMI2 and SMI2 > SMI3;
Scond1 = SMI1 < SMI2 and SMI2 < SMI3;
Bcond2 = SMI4 > SMI5 and SMI5 > SMI6 and SMI6 > SMI7;
Scond2 = SMI4 < SMI5 and SMI5 < SMI6 and SMI6 < SMI7;
if MarketPosition <= 0 then
{
if Bcond1 == true and Bcond1[1] == false Then
{
T = 1;
}
if T == 1 and Bcond1 == true Then
buy("b1",atlimit,BBdn);
}
if MarketPosition <= 0 then
{
if Bcond2 == true and Bcond2[1] == false Then
{
T = 1;
}
if T == 1 and Bcond2 == true Then
buy("b2",atlimit,BBdn);
}
if MarketPosition >= 0 then
{
if Scond1 == true and Scond1[1] == false Then
{
T = -1;
}
if T == -1 and Scond1 == true then
sell("s",Atlimit,BBup);
}
if MarketPosition >= 0 then
{
if Scond2 == true and Scond2[1] == false Then
{
T = -1;
}
if T == -1 and Scond2 == true then
sell("s2",Atlimit,BBup);
}
if MarketPosition == 1 then
{
exitlong("bx",atlimit,bbup);
}
if MarketPosition == -1 then
{
ExitShort("sx",atlimit,bbdn);
}
즐거운 하루되세요
> 진짜원칙매매 님이 쓴 글입니다.
> 제목 : 64491질문자입니다.~한가지 식만 더 부탁드립니다. 죄송합니다.
> input : Period11(1),Period12(2),Period13(3);
input : Period21(4),Period22(5),Period23(6);
input : Period31(7),Period32(8),Period33(9);
Input : Period(20), MultiD(2);
var : SMI1(0),SMI2(0),SMI3(0),Bcond(false),Scond(false);
var : BBmd(0),BBup(0),BBdn(0),T(0);
SMI1 = SMI(Period11,Period12,Period13);
SMI2 = SMI(Period21,Period22,Period23);
SMI3 = SMI(Period31,Period32,Period33);
BBmd = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
Bcond = SMI1 > SMI2 and SMI2 > SMI3 and SMI3 ;
SMI1 = SMI(Period11,Period12,Period13);
SMI2 = SMI(Period21,Period22,Period23);
SMI3 = SMI(Period31,Period32,Period33);
Scond = SMI1 < SMI2 and SMI2 < SMI3 and SMI3;
if MarketPosition <= 0 then
{
if Bcond == true and Bcond[1] == false Then
{
T = 1;
}
if T == 1 and Bcond == true Then
buy("b",atlimit,BBdn);
}
if MarketPosition >= 0 then
{
if Scond == true and Scond[1] == false Then
{
T = -1;
}
if T == -1 and Scond == true then
sell("s",Atlimit,BBup);
}
if MarketPosition == 1 then
{
exitlong("bx",atlimit,bbup);
}
if MarketPosition == -1 then
{
ExitShort("sx",atlimit,bbdn);
}
위 식에서 조건을 하나만 더 달고 싶습니다.
input : Period11(1),Period12(2),Period13(3);
input : Period21(4),Period22(5),Period23(6);
input : Period31(7),Period32(8),Period33(9);
에서
input : Period11(10),Period12(11),Period13(12);
input : Period21(13),Period22(14),Period23(15);
input : Period31(16),Period32(17),Period33(18);
input : Period31(19),Period32(20),Period33(21);
SMI4 = SMI(Period41,Period42,Period43);
SMI5 = SMI(Period51,Period52,Period53);
SMI6 = SMI(Period61,Period62,Period63);
SMI7 = SMI(Period71,Period72,Period73);
Bcond = SMI4 > SMI5 and SMI5 > SMI6 and SMI6 > smi7 ;
Scond = SMI4 < SMI5 and SMI6 < SMI6 and SMI6 < smi7 ;
스톡으로 4개의 선을 더 만들어서 조건에 추가 싶으고 싶습니다. 위와 같이 4개의 선이 정배열일때 제일 위에 조건식이 맞으면 매수 진입 역배열이면 매도 진입 입니다.
부탁드립니다.~~~ps 제가 추가 하고 싶은 4개의 선은 위의 smi1 smi2 smi3와는 별개의 조건입니다.
다음글