예스스탁
예스스탁 답변
2016-03-14 10:46:11
안녕하세요
예스스탁입니다.
Input : r(100), s(200), SMTHLEN(50),하루손실틱수(70);
VAR : TSIv(0),TSIS(0),T(0);
var : NP(0),PreNP(0),DayPL(0),dayloss(0),Xcond(false);
NP = NetProfit;
if stime ==153000 or (stime > 153000 and stime[1] < 153000) Then{
preNP = NP[1];
Xcond = false;
}
dayPL = NP-PreNP;
dayloss = PriceScale*하루손실틱수;
if TotalTrades > TotalTrades[1] and (IsExitName("bl",1) or IsExitName("sl",1)) Then
Xcond = true;
Value1 = 100 * Ema(Ema(c-c[1], r), s) ;
Value2 = Ema(Ema(abs(c-c[1]), r), s) ;
TSIv = Value1 / Value2;
TSIS = Ema(TSIv, SMTHLEN);
if TSIS > TSIS[1] Then
T = 1;
if TSIS < TSIS[1] Then
T = -1;
if (stime >= 153000 or stime < 023000) and Xcond == false then{
if T == 1 and T[1] != 1 Then
buy();
if T == -1 and T[1] != -1 Then
sell();
}
SetStopLoss(PriceScale*30,PointStop);
SetStopProfittarget(PriceScale*15,PointStop);
if MarketPosition == 1 Then{
ExitLong("bl",AtStop,EntryPrice-(dayloss+dayPL));
}
if MarketPosition == -1 Then{
ExitShort("sl",AtStop,EntryPrice+(dayloss+daypl) );
}
if stime == 023000 or (stime > 023000 and stime[1] < 023000) Then{
exitlong("bx");
ExitShort("sx");
}
즐거운 하루되세요
> 비류천 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 수고하십니다.
아래 수식으로 크루드오일 시스템을 만들고 싶습니다.
*크루드오일 시스템
1)진입
TSIS > TSIS[1] 되면 매수
TSIS < TSIS[1] 되면 매도
2)익절 : 15틱
손절 : 30틱
3)거래시간 : 당일 15시30분 ~ 다음날 새벽 02시 30분
4)거래 종료 : 실시간으로 최대손실 70틱되는 순간 모두 청산하고 거래 종료
----------------------------------------------------------
Input : r(100), s(200), SMTHLEN(50);
VAR : TSIv(0),TSIS(0),T(0);
Value1 = 100 * Ema(Ema(c-c[1], r), s) ;
Value2 = Ema(Ema(abs(c-c[1]), r), s) ;
TSIv = Value1 / Value2;
TSIS = Ema(TSIv, SMTHLEN);
//plot1(TSIV);
//plot2(TSIS);
PlotBaseLine1(20);
PlotBaseLine2(0);
PlotBaseLine3(-20);
if TSIS > TSIS[1] Then
T = 1;
if TSIS < TSIS[1] Then
T = -1;
if T == 1 Then
plot1(TSIS,"sig",RED);
Else
plot1(TSIS,"sig",BLUE);