커뮤니티
wjdtkstntlr
2011-04-22 22:29:15
663
글번호 37881
if marketposition() == 1 then {
if C >= entryprice()+tp*(PriceScale*10) then
exitlong("tpb");
}
if marketposition() == 1 then {
if C <= entryprice()- sl*(PriceScale*10) then
exitlong("slb");
}
if marketposition() == -1 then {
if C >= entryprice()- tp*(PriceScale*10) then
exitshort("tps");
}
if marketposition() == -1 then {
if C <= entryprice()+ sl*(PriceScale*10) then
exitshort("sls");
}
- 1. 김선생님.docx (0.01 MB)
답변 1
예스스탁 예스스탁 답변
2011-04-25 10:39:24
안녕하세요
예스스탁입니다.
매도청산 부분의 부등호가 반대로 되어 있습니다.
if marketposition() == -1 then {
if C <= entryprice()- tp*(PriceScale*10) then
exitshort("tps");
}
if marketposition() == -1 then {
if C >= entryprice()+ sl*(PriceScale*10) then
exitshort("sls");
}
와 같이 작성이 되어야 합니다.
봉 미완성시 즉시 신호발생하시기 위해서는
아래와 같이 작성하셔도 됩니다.
input : tp(150), sl(50);
if marketposition() == 1 then {
exitlong("tpb",AtLimit,entryprice+tp*(PriceScale*10));
}
if marketposition() == 1 then {
exitlong("slb",AtStop,entryprice-sl*(PriceScale*10));
}
if marketposition() == -1 then {
exitshort("tps",AtLimit,entryprice-tp*(PriceScale*10));
}
if marketposition() == -1 then {
exitshort("sls",AtStop,entryprice+sl*(PriceScale*10));
}
혹은 간단히
SetStopProfittarget(tp*(PriceScale*10),PointStop);
SetStopLoss(sl*(PriceScale*10),PointStop);
와 같이 작성하셔도 됩니다.
즐거운 하루되세요
> 골드핑거 님이 쓴 글입니다.
> 제목 : wjdtkstntlr
> if marketposition() == 1 then {
if C >= entryprice()+tp*(PriceScale*10) then
exitlong("tpb");
}
if marketposition() == 1 then {
if C <= entryprice()- sl*(PriceScale*10) then
exitlong("slb");
}
if marketposition() == -1 then {
if C >= entryprice()- tp*(PriceScale*10) then
exitshort("tps");
}
if marketposition() == -1 then {
if C <= entryprice()+ sl*(PriceScale*10) then
exitshort("sls");
}
다음글