첨부 이미지
그림1
input : 익절틱수(200),손절틱수(30);
if NextBarSdate != sDate Then
{
if NextBarOpen <= C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*18);
Sell("s",AtStop,NextBarOpen-PriceScale*18);
}
if NextBarOpen >= C Then
{
ExitLong("bx",AtStop,NextBarOpen-PriceScale*1);
ExitShort("sx",AtStop,NextBarOpen+PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
Sell("s1",AtStop,EntryPrice-2);
if MarketPosition == -1 Then
Buy("b1",AtStop,EntryPrice+2);
if MarketPosition == 1 Then
Sell("s2",AtStop,EntryPrice-4);
if MarketPosition == -1 Then
Buy("b2",AtStop,EntryPrice+4);
---------------
input : 익절틱수(200),손절틱수(30);
if NextBarSdate != sDate Then
{
if NextBarOpen >= C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*18);
Sell("s",AtStop,NextBarOpen-PriceScale*18);
}
if NextBarOpen <= C Then
{
Sell("bx",AtStop,NextBarOpen-PriceScale*1);
Buy("sx",AtStop,NextBarOpen+PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
Sell("s1",AtStop,EntryPrice-2);
if MarketPosition == -1 Then
Buy("b1",AtStop,EntryPrice+2);
if MarketPosition == 1 Then
Sell("s2",AtStop,EntryPrice-4);
if MarketPosition == -1 Then
Buy("b2",AtStop,EntryPrice+4);
------------------------------
위 2가지는 일봉매매의 수식어 입니다.
buy,sell 각각 진입신호후 손절 1회로
그 이후 매매신호가 없습니다.
손절도 목표치를 달성한것이라 추가 신호가 없는것은 일봉매매의 특성인건지
문의 드리고 예전에 이런 문제때문에 분봉으로 전환후 로직을 돌렸었는데
24시부터 시가신호가 나오고 진입청산이 많아서 도저히 할수가 없었습니다.
답변 1
예스스탁
예스스탁 답변
2022-09-23 10:15:00
안녕하세요
예스스탁입니다.
수식에서 if문은 봉완성시가 기준이고 각각의 Buy와 Sell은 한봉에서 1회만 동작합니다.
한봉에서 특정값을 여러번 터치하는 것을 체크해 여러번 진입하게 할 수 없습니다.
그러므로 특정값을 기준으로 여러번 진입을 하려면 분봉이하에서 주기에서 구현되게 식을 작성하셔야 합니다.
즐거운 하루되세요
> 푸른 님이 쓴 글입니다.
> 제목 : 문의 드립니다.
> input : 익절틱수(200),손절틱수(30);
if NextBarSdate != sDate Then
{
if NextBarOpen <= C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*18);
Sell("s",AtStop,NextBarOpen-PriceScale*18);
}
if NextBarOpen >= C Then
{
ExitLong("bx",AtStop,NextBarOpen-PriceScale*1);
ExitShort("sx",AtStop,NextBarOpen+PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
Sell("s1",AtStop,EntryPrice-2);
if MarketPosition == -1 Then
Buy("b1",AtStop,EntryPrice+2);
if MarketPosition == 1 Then
Sell("s2",AtStop,EntryPrice-4);
if MarketPosition == -1 Then
Buy("b2",AtStop,EntryPrice+4);
---------------
input : 익절틱수(200),손절틱수(30);
if NextBarSdate != sDate Then
{
if NextBarOpen >= C Then
{
Buy("b",AtStop,NextBarOpen+PriceScale*18);
Sell("s",AtStop,NextBarOpen-PriceScale*18);
}
if NextBarOpen <= C Then
{
Sell("bx",AtStop,NextBarOpen-PriceScale*1);
Buy("sx",AtStop,NextBarOpen+PriceScale*1);
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if MarketPosition == 1 Then
Sell("s1",AtStop,EntryPrice-2);
if MarketPosition == -1 Then
Buy("b1",AtStop,EntryPrice+2);
if MarketPosition == 1 Then
Sell("s2",AtStop,EntryPrice-4);
if MarketPosition == -1 Then
Buy("b2",AtStop,EntryPrice+4);
------------------------------
위 2가지는 일봉매매의 수식어 입니다.
buy,sell 각각 진입신호후 손절 1회로
그 이후 매매신호가 없습니다.
손절도 목표치를 달성한것이라 추가 신호가 없는것은 일봉매매의 특성인건지
문의 드리고 예전에 이런 문제때문에 분봉으로 전환후 로직을 돌렸었는데
24시부터 시가신호가 나오고 진입청산이 많아서 도저히 할수가 없었습니다.