커뮤니티
수정부탁드립니다.
2019-10-08 10:36:34
144
글번호 132587
안녕하세요?
아래수식을 조금만 고쳐주시면 감사하겠습니다.
***내용
CME전용으로만 사용하려고합니다.
그리고 시작시간과 끝나는 시간을 외부변수로 설정하고싶습니다.
감사합니다.
input : 익절틱수(50),손절틱수(50),n(10);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if C > O and C[1] < O[1] and
O > C[1] and C < O[1] Then
{
if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry >= n) then
buy("b1");
}
if C > O and C[1] < O[1] and
O < C[1] and C > O[1] Then
{
if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry >= n) then
buy("b2");
}
if C < O and C[1] > O[1] and
O < C[1] and C > O[1] Then
{
if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry >= n) then
sell("s1");
}
if C < O and C[1] > O[1] and
O > C[1] and C < O[1] Then
{
if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry >= n) then
sell("s2");
}
답변 1
예스스탁 예스스탁 답변
2019-10-08 13:46:55
안녕하세요
예스스탁입니다.
input : 익절틱수(50),손절틱수(50),n(10);
input : starttime(180000),endtime(050000);
var : Tcond(false);
if (sdate != sdate[1] and stime >= endtime) or
(sdate == sdate[1] and stime >= endtime and stime[1] < endtime) then
{
Tcond = false;
if MarketPosition == 1 Then
ExitLong("bx");
if MarketPosition == -1 Then
ExitShort("sx");
}
if (sdate != sdate[1] and stime >= starttime) or
(sdate == sdate[1] and stime >= starttime and stime[1] < starttime) then
{
Tcond = true;
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if Tcond == true then
{
if C > O and C[1] < O[1] and
O > C[1] and C < O[1] Then
{
if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry >= n) then
buy("b1");
}
if C > O and C[1] < O[1] and
O < C[1] and C > O[1] Then
{
if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry >= n) then
buy("b2");
}
if C < O and C[1] > O[1] and
O < C[1] and C > O[1] Then
{
if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry >= n) then
sell("s1");
}
if C < O and C[1] > O[1] and
O > C[1] and C < O[1] Then
{
if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry >= n) then
sell("s2");
}
}
즐거운 하루되세요
> 대구어린울프 님이 쓴 글입니다.
> 제목 : 수정부탁드립니다.
> 안녕하세요?
아래수식을 조금만 고쳐주시면 감사하겠습니다.
***내용
CME전용으로만 사용하려고합니다.
그리고 시작시간과 끝나는 시간을 외부변수로 설정하고싶습니다.
감사합니다.
input : 익절틱수(50),손절틱수(50),n(10);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
if C > O and C[1] < O[1] and
O > C[1] and C < O[1] Then
{
if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry >= n) then
buy("b1");
}
if C > O and C[1] < O[1] and
O < C[1] and C > O[1] Then
{
if MarketPosition == 0 or (MarketPosition == -1 and BarsSinceEntry >= n) then
buy("b2");
}
if C < O and C[1] > O[1] and
O < C[1] and C > O[1] Then
{
if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry >= n) then
sell("s1");
}
if C < O and C[1] > O[1] and
O > C[1] and C < O[1] Then
{
if MarketPosition == 0 or (MarketPosition == 1 and BarsSinceEntry >= n) then
sell("s2");
}