커뮤니티
안녕하세요
2018-07-09 21:54:40
121
글번호 120410
매수조건 현재가가 60이평위에있고 5이평이 20이평을골드크로스할때 매수
매도조건 현재가가 60이평위에아래에있고 5이평이 20이평을데드크로스할때 매도
매매시간 22시30분 부터 다음날05시까지 05시에 포지션 강제청산
손절50틱 익절150틱
최대수익에서 -50틱 이면 강제청산
매매중 손실이-150틱이거나 이익이+150틱이면 강제청산후 진입금지
부탁합니다
답변 1
예스스탁 예스스탁 답변
2018-07-11 09:21:56
안녕하세요
예스스탁입니다.
input : starttime(223000),endtime(050000);
Input : 당일수익틱수(150),당일손실틱수(150);
var : Tcond(false);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
}
daypl = NetProfit-N1;
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();
if MarketPosition == -1 Then
ExitShort();
}
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;
var1 = ma(C,5);
var2 = ma(C,20);
var3 = ma(C,60);
if Tcond == true and Xcond == false then
{
if C > var3 and crossup(var1,var2) Then
buy();
if C < var3 and CrossDown(var1,var2) Then
sell();
if MarketPosition == 1 then
{
ExitLong("bx",AtStop,highest(h,BarsSinceEntry)-PriceScale*50);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
ExitShort("sx",AtStop,highest(h,BarsSinceEntry)-PriceScale*50);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
}
SetStopProfittarget(PriceScale*150,PointStop);
SetStopLoss(PriceScale*50,PointStop);
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 매수조건 현재가가 60이평위에있고 5이평이 20이평을골드크로스할때 매수
매도조건 현재가가 60이평위에아래에있고 5이평이 20이평을데드크로스할때 매도
매매시간 22시30분 부터 다음날05시까지 05시에 포지션 강제청산
손절50틱 익절150틱
최대수익에서 -50틱 이면 강제청산
매매중 손실이-150틱이거나 이익이+150틱이면 강제청산후 진입금지
부탁합니다
다음글
이전글