커뮤니티
안녕하세요
2019-08-28 11:44:22
197
글번호 131538
매매시간 오전10시부터 다음날 05시까지 매매하되
포지션이있으면 새벽 05 시에 강제청산
매수 5 이평선이 20 이평 골드 크로스
매도 5 이평선이 20 이평 데드크로스
손절 50틱 익절 50틱
인풋으로 서식 부탁합니다
당일매매중에 수익이 100 틱발생시 강제청산
당일 매매중 손실이 100 틱발생시 강제청산으로 1서식 작성해주시고요
2서식은 다른조건은 같고요
트릭스가0선돌피시 매수
0선 붕괴시 매도로 2서식 부탁합니다
답변 1
예스스탁 예스스탁 답변
2019-08-29 09:26:53
안녕하세요
예스스탁입니다.
1
input : starttime(100000),endtime(050000);
input : P1(5),P2(20);
input : 익절틱수(50),손절틱수(50);
Input : 당일수익틱수(80),당일손실틱수(80);
var : Tcond(false);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
Xcond = false;
N1 = NetProfit;
}
var1 = ma(C,P1);
var2 = ma(C,P2);
if Tcond == true then
{
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
if Xcond == false then
{
if crossup(var1,var2) Then
buy("b");
if CrossDown(var1,var2) Then
sell("s");
}
if MarketPosition == 1 then{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
2
input : starttime(100000),endtime(050000);
input : P(12);
input : 익절틱수(50),손절틱수(50);
Input : 당일수익틱수(80),당일손실틱수(80);
var : Tcond(false);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
Xcond = false;
N1 = NetProfit;
}
var1 = TRIX(P);
if Tcond == true then
{
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbp",1) == true or IsExitName("dbl",1) == true or
IsExitName("dsp",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
if Xcond == false then
{
if crossup(var1,0) Then
buy("b");
if CrossDown(var1,0) Then
sell("s");
}
if MarketPosition == 1 then{
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
SetStopLoss(PriceScale*손절틱수,PointStop);
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 매매시간 오전10시부터 다음날 05시까지 매매하되
포지션이있으면 새벽 05 시에 강제청산
매수 5 이평선이 20 이평 골드 크로스
매도 5 이평선이 20 이평 데드크로스
손절 50틱 익절 50틱
인풋으로 서식 부탁합니다
당일매매중에 수익이 100 틱발생시 강제청산
당일 매매중 손실이 100 틱발생시 강제청산으로 1서식 작성해주시고요
2서식은 다른조건은 같고요
트릭스가0선돌피시 매수
0선 붕괴시 매도로 2서식 부탁합니다