예스스탁
예스스탁 답변
2023-02-10 16:20:14
안녕하세요
예스스탁입니다.
현재 수식이 봉자체가 완전히 아래에 있다가(고가가 상단선 아래에 있는 상태에서)
상승해서 처음 상단 터치할때 매수
완전히 위에 있다가(저가가 하단선 위에 있는 상태에서)
하락해서 처음 하단터치할때 매도입니다.
올리신 내용이면 위 조건을 지정하지는 못합니다.
아래와 같이 해당 조건 제외하면
상단선 이상의 시세가 발생하면 매수
하단선 이하의 시세가 발생하면 매도가 됩니다.
input : ndate(20220210),ntime(00000);
input : Price(324.00),ntick(5);;
var1 = Price + PriceScale*ntick;
var2 = Price - PriceScale*ntick;
if sDate >= ndate and sTime > ntime Then
Condition1 = true;
if Condition1 == true Then
{
Buy("b",AtStop,var1);
Sell("s",AtStop,var2);
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 재문의드립니다.
> 1. 아래 2번에 만들어 주신 수식을 적용해 보면
3시 31분에 매수가 나가고 매도로 더 이상 진행이 되지 않았습니다.
그리고 같은 봉에서도 현재가가 수시로 변할 때 매수 매도가 변환되도록 부탁드립니다,
같은 봉에서는 매매가 3개 정도만 되도록 수행하도록 고쳐 주시면 나머지 추가 수정른
제가 수정해서 붙여 놓갰습니다.
2. 두번째 문의는 위의 수식은 특정 가격 기준으로 위 아래로 매수 매도가 반복되는 것인데요.
특정가격 기준으로 하락시 매도만 하고 다시 상승시 전에는 매수로 전환 했는데
전처럼 매수로 전환하지 않고 그냥 매도 청산만 하고 싶습니다.
즉 하락 배팅에만 올인하는 수식을 하나더 부탁드립니다.
안녕하세요
예스스탁입니다.
1
올리신 식은
시가에서 5틱 상승하면 매수
시가에서 5틱 하락하면 매도
봉완성시 다음봉 시가 청산입니다.
동일 내용이 반복해서 쓰여진 이유는
수식에서 하나의 Buy나 sell은 한봉에 한번만 동작합니다.
한봉에서 여러번 시가+5틱과 시가-5틱을 왔다 갓다 반복할때
여러번 진입하기 위해 동일내용을 여러번 작성해 나열한 것입니다.
2
input : ndate(20220209),ntime(90000);
input : Price(324.00),ntick(5);;
var1 = Price + PriceScale*ntick;
var2 = Price - PriceScale*ntick;
if sDate >= ndate and sTime > ntime Then
Condition1 = true;
if Condition1 == true Then
{
if H < var1 Then
Buy("b",AtStop,var1);
if L > var2 Then
Sell("s",AtStop,var2);
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 아래수식을 보아도 코딩 지식이 없어서 어떻게 매수 매도 되는
원리인지 해석을 할 수가 없네요.
식들이 어떤 의미로 매수가 되고 청산되며 다시
매도되고 청산되는 지를 알고 싶습니다.
그리고 제가 원하는 수식은
특정 날자와 시간과 특정 가격을 input 으로 하고요.
어떤 특정 가격 A 를 input 으로 임의로 정해주고
특정 날자와 시간 이후에 기다리고 있다가 아래나 위에 있던 현재가 상승 또는 하락하여 A 가격에 도달하면 비로서 매수 매도가 활성화 되어서
그 가격 A + PriceScale*5 을 현재가가 한번 위로 터치하면 매수하고 계속 위로 올라가면
놓아두고 다시 아래로 떨어져서 A - PriceScale*5 를 터치하면 매수청산과 더불어서 히방으로 1계약 매도합니다. 이런 식으로 계속 반복합니다.
현재가가 A + PriceScale*5 위로 도달시 매수 1게약
현재가가 A - PriceScale*5 아래로 도달시 매도 1게약
을 반복하는 것입니다.
아래 수식처럼 비슷하게 하면 ATSTOP 함수를 써서 가능할 것 같은데요.
아래 수식에서 ExitLong("bx",AtMarket); 이 왜 수식으로 게속 와야 하는 지 등를
모르겠어요.
제가 원하는 수식도 마저 부탁드립니다.
늘 수고하심에 감사드립니다.
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx",AtMarket);
if NextBarOpen != C Then
{
Buy("b1",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx1",AtMarket);
if NextBarOpen != C Then
{
Buy("b2",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx2",AtMarket);
if NextBarOpen != C Then
{
Buy("b3",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx3",AtMarket);
if NextBarOpen != C Then
{
Buy("b4",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx4",AtMarket);
if NextBarOpen != C Then
{
Buy("b5",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx5",AtMarket);
if NextBarOpen == C Then
{
Buy("b6",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx6",AtMarket);
if NextBarOpen == C Then
{
Buy("b7",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx7",AtMarket);
if NextBarOpen == C Then
{
Buy("b8",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx8",AtMarket);
if NextBarOpen == C Then
{
Buy("b9",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx9",AtMarket);
if NextBarOpen == C Then
{
Buy("b10",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx10",AtMarket);
if NextBarOpen == C Then
{
Buy("b11",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx11",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx",AtMarket);
if NextBarOpen != C Then
{
Sell("s1",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx1",AtMarket);
if NextBarOpen != C Then
{
Sell("s2",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx2",AtMarket);
if NextBarOpen != C Then
{
Sell("s3",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx3",AtMarket);
if NextBarOpen != C Then
{
Sell("s4",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx4",AtMarket);
if NextBarOpen != C Then
{
Sell("s5",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx5",AtMarket);
if NextBarOpen == C Then
{
Sell("s6",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx6",AtMarket);
if NextBarOpen == C Then
{
Sell("s7",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx7",AtMarket);
if NextBarOpen == C Then
{
Sell("s8",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx8",AtMarket);
if NextBarOpen == C Then
{
Sell("s9",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx9",AtMarket);
if NextBarOpen == C Then
{
Sell("s10",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx10",AtMarket);
if NextBarOpen == C Then
{
Sell("s11",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx11",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b12",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx12",AtMarket);
if NextBarOpen != C Then
{
Buy("b13",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx13",AtMarket);
if NextBarOpen != C Then
{
Buy("b14",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx14",AtMarket);
if NextBarOpen != C Then
{
Buy("b15",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx15",AtMarket);
if NextBarOpen != C Then
{
Buy("b16",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx16",AtMarket);
if NextBarOpen != C Then
{
Buy("b17",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx17",AtMarket);
if NextBarOpen == C Then
{
Buy("b18",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx18",AtMarket);
if NextBarOpen == C Then
{
Buy("b19",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx19",AtMarket);
if NextBarOpen == C Then
{
Buy("b20",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx20",AtMarket);
if NextBarOpen == C Then
{
Buy("b21",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx21",AtMarket);
if NextBarOpen == C Then
{
Buy("b22",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx22",AtMarket);
if NextBarOpen == C Then
{
Buy("b23",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx23",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s12",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx12",AtMarket);
if NextBarOpen != C Then
{
Sell("s13",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx13",AtMarket);
if NextBarOpen != C Then
{
Sell("s14",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx14",AtMarket);
if NextBarOpen != C Then
{
Sell("s15",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx15",AtMarket);
if NextBarOpen != C Then
{
Sell("s16",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx16",AtMarket);
if NextBarOpen != C Then
{
Sell("s17",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx17",AtMarket);
if NextBarOpen == C Then
{
Sell("s18",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx18",AtMarket);
if NextBarOpen == C Then
{
Sell("s19",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx19",AtMarket);
if NextBarOpen == C Then
{
Sell("s20",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx20",AtMarket);
if NextBarOpen == C Then
{
Sell("s21",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx21",AtMarket);
if NextBarOpen == C Then
{
Sell("s22",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx22",AtMarket);
if NextBarOpen == C Then
{
Sell("s23",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx23",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Buy("b24",AtStop,NextBarOpen+PriceScale*5);
}
}
ExitLong("bx24",AtMarket);
if NextBarOpen != C Then
{
Buy("b25",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx25",AtMarket);
if NextBarOpen != C Then
{
Buy("b26",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx26",AtMarket);
if NextBarOpen != C Then
{
Buy("b27",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx27",AtMarket);
if NextBarOpen != C Then
{
Buy("b28",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx28",AtMarket);
if NextBarOpen != C Then
{
Buy("b29",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx29",AtMarket);
if NextBarOpen == C Then
{
Buy("b30",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx30",AtMarket);
if NextBarOpen == C Then
{
Buy("b31",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx31",AtMarket);
if NextBarOpen == C Then
{
Buy("b32",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx32",AtMarket);
if NextBarOpen == C Then
{
Buy("b33",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx33",AtMarket);
if NextBarOpen == C Then
{
Buy("b34",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx34",AtMarket);
if NextBarOpen == C Then
{
Buy("b35",AtStop,NextBarOpen+PriceScale*5);
}
ExitLong("bx35",AtMarket);
if NextBarSdate != sDate Then
{
if NextBarOpen != C Then
{
Sell("s24",AtStop,NextBarOpen-PriceScale*5);
}
}
ExitShort("sx24",AtMarket);
if NextBarOpen != C Then
{
Sell("s25",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx25",AtMarket);
if NextBarOpen != C Then
{
Sell("s26",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx26",AtMarket);
if NextBarOpen != C Then
{
Sell("s27",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx27",AtMarket);
if NextBarOpen != C Then
{
Sell("s28",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx28",AtMarket);
if NextBarOpen != C Then
{
Sell("s29",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx29",AtMarket);
if NextBarOpen == C Then
{
Sell("s30",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx30",AtMarket);
if NextBarOpen == C Then
{
Sell("s31",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx31",AtMarket);
if NextBarOpen == C Then
{
Sell("s32",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx32",AtMarket);
if NextBarOpen == C Then
{
Sell("s33",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx33",AtMarket);
if NextBarOpen == C Then
{
Sell("s34",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx34",AtMarket);
if NextBarOpen == C Then
{
Sell("s35",AtStop,NextBarOpen-PriceScale*5);
}
ExitShort("sx35",AtMarket);