예스스탁
예스스탁 답변
2024-02-20 14:06:17
안녕하세요
예스스탁입니다.
랭귀지의 if문이나 텍스트등은 모두 봉완성시점을 기준으로 합니다.
봉완성은 다음봉시가가 수신때입니다.
완성봉의 시가는 이미 과거 시점으로 해당 시점에 신호표시는 불가능합니다.
다음봉시가에 신호, 다음봉 종가에 청산으로 작성해 드립니다.
1
input : 손실틱수(20);
if long Then
{
tx = Text_New(sDate,sTime,L,"Long");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Lime);
Buy("b",AtMarket,Def,5);
}
if short Then
{
tx = Text_New(sDate,sTime,H,"Short");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
Sell("s",AtMarket,Def,5);
}
SetStopLoss(PriceScale*손실틱수, PointStop);
SetStopEndofday(150000);
2
input : 손실틱수(20);
if long Then
{
tx = Text_New(sDate,sTime,L,"Long");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Lime);
Buy("b",AtMarket,Def,5);
}
if short Then
{
tx = Text_New(sDate,sTime,H,"Short");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
Sell("s",AtMarket,Def,5);
}
if MarketPosition == 1 and BarsSinceEntry == 1 Then
ExitLong("bx");
if MarketPosition == -1 and BarsSinceEntry == 1 Then
ExitShort("sx");
SetStopLoss(PriceScale*손실틱수, PointStop);
SetStopEndofday(150000);
즐거운 하루되세요
> 아이덜 님이 쓴 글입니다.
> 제목 : 수식변경부탁드려요 도사님.
> 1
if long Then
{
tx = Text_New(sDate,sTime,L,"Long");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Lime);
Buy("b",OnClose,Def,5);
}
if short Then
{
tx = Text_New(sDate,sTime,H,"Short");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
Sell("s",OnClose,Def,5);
}
SetStopEndofday(150000);
2
if long Then
{
tx = Text_New(sDate,sTime,L,"Long");
Text_SetStyle(tx,2,0);
Text_SetColor(tx,Lime);
Buy("b",OnClose,Def,5);
}
if short Then
{
tx = Text_New(sDate,sTime,H,"Short");
Text_SetStyle(tx,2,1);
Text_SetColor(tx,Red);
Sell("s",OnClose,Def,5);
}
if MarketPosition == 1 and BarsSinceEntry == 1 Then
ExitLong("bx");
if MarketPosition == -1 and BarsSinceEntry == 1 Then
ExitShort("sx");
SetStopEndofday(150000);
/////////////////////////////////////////////////////////////////////////
1.텍스트발생시 분봉시가기준 진입 --> 다음봉 종가기준 청산
도사님 , 부탁드립니다.
텍스트발생 후 5계약 진입시 분봉 종가 기준으로 진입을 하게되어있는데,
시가기준으로 바꿀수 있을까요? 안된다면 다음봉 시작가로 부탁드립니다.
(손실로스 진입단가 강제청산 및 틱수설정)