안녕하세요?
자세한 내용 답변 감사히 받았습니다. 덕분에 큰 도움되었습니다.
근데 익절은 정확히 이루어지나, 손절이 잘 안됩니다. 외부변수에 입력을 바꿔도 수치가 달라지지가않네요.
이부부만 추가로 수정부탁드립니다.
감사합니다.
input :양봉틱수(5),음봉틱수(5),익절틱수(50),손절틱수(50),진입횟수(3);
var : entry(0);
if bdate != bdate[1] Then
{
entry = 0;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if MarketPosition == 0 and C == O+양봉틱수*PriceScale and entry < 진입횟수 Then
{
buy("b");
}
if MarketPosition == 0 and C == O-음봉틱수*PriceScale and entry < 진입횟수 Then
{
sell("s");
}
if MarketPosition == 1 and entry < 진입횟수 Then
{
if entry < 진입횟수 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
Else
ExitLong("bx",AtStop,EntryPrice-PriceScale*손절틱수);
}
if MarketPosition == -1 and entry < 진입횟수 Then
{
if entry < 진입횟수 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
Else
ExitShort("sx",AtStop,EntryPrice+PriceScale*손절틱수);
}
SetStopProfittar
답변 1
예스스탁
예스스탁 답변
2020-02-06 15:45:46
안녕하세요
예스스탁입니다.
수치는 정상적으로 변경되고 있습니다.
청산식만 아래와 같이 분리한 내용으로 변경하시기 바랍니다.
input :양봉틱수(5),음봉틱수(5),익절틱수(50),손절틱수(50),진입횟수(3);
var : entry(0);
if bdate != bdate[1] Then
{
entry = 0;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if MarketPosition == 0 and C == O+양봉틱수*PriceScale and entry < 진입횟수 Then
{
buy("b");
}
if MarketPosition == 0 and C == O-음봉틱수*PriceScale and entry < 진입횟수 Then
{
sell("s");
}
if MarketPosition == 1 and entry < 진입횟수 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
if MarketPosition == 1 and entry == 진입횟수 Then
ExitLong("bx",AtStop,EntryPrice-PriceScale*손절틱수);
if MarketPosition == -1 and entry < 진입횟수 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
if MarketPosition == -1 and entry == 진입횟수 Then
ExitShort("sx",AtStop,EntryPrice+PriceScale*손절틱수);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다.
> 안녕하세요?
자세한 내용 답변 감사히 받았습니다. 덕분에 큰 도움되었습니다.
근데 익절은 정확히 이루어지나, 손절이 잘 안됩니다. 외부변수에 입력을 바꿔도 수치가 달라지지가않네요.
이부부만 추가로 수정부탁드립니다.
감사합니다.
input :양봉틱수(5),음봉틱수(5),익절틱수(50),손절틱수(50),진입횟수(3);
var : entry(0);
if bdate != bdate[1] Then
{
entry = 0;
}
if MarketPosition != 0 and MarketPosition != MarketPosition[1] Then
entry = entry+1;
if MarketPosition == 0 and C == O+양봉틱수*PriceScale and entry < 진입횟수 Then
{
buy("b");
}
if MarketPosition == 0 and C == O-음봉틱수*PriceScale and entry < 진입횟수 Then
{
sell("s");
}
if MarketPosition == 1 and entry < 진입횟수 Then
{
if entry < 진입횟수 Then
sell("bs",AtStop,EntryPrice-PriceScale*손절틱수);
Else
ExitLong("bx",AtStop,EntryPrice-PriceScale*손절틱수);
}
if MarketPosition == -1 and entry < 진입횟수 Then
{
if entry < 진입횟수 Then
buy("sb",AtStop,EntryPrice+PriceScale*손절틱수);
Else
ExitShort("sx",AtStop,EntryPrice+PriceScale*손절틱수);
}
SetStopProfittar