커뮤니티
안녕하세요
2019-01-21 11:46:28
200
글번호 125434
매매시간 오전10시16분부터오후5시까지
매수조건
5 이평이 20 이평 골드크로스 매수
매도조건
5 이평이 20 이평 데드크로스 매도
당일 순이익이 100 틱 이면 매매정지
당일 순손실이 -100 틱이면 매매정지
손절 50 틱
익절 150 틱
매매중 수익이 50 틱이상 갓다가 수익이20 틱아래로내려오면 강제청산후 다음신호대기
답변 1
예스스탁 예스스탁 답변
2019-01-21 16:20:45
안녕하세요
예스스탁입니다.
Input : 손절틱수(50),익절틱수(50),당일수익틱수(100),당일손실틱수(100);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
var1 = ma(C,5);
var2 = ma(C,20);
if Bdate != Bdate[1] Then
{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] Then
{
if daypl >= 당일수익 or daypl <= -당일손실 Then
Xcond = true;
if (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
{
if highest(H,BarsSinceEntry) >= EntryPrice+PriceScale*50 Then
ExitLong("bx",AtStop,EntryPrice+PriceScale*20);
ExitLong("dbp",atlimit,EntryPrice+((당일수익-daypl)/CurrentContracts));
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then
{
if Lowest(L,BarsSinceEntry) <= EntryPrice-PriceScale*50 Then
ExitShort("sx",AtStop,EntryPrice-PriceScale*20);
ExitShort("dsp",atlimit,EntryPrice-((당일수익-daypl)/CurrentContracts));
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
SetStopLoss(PriceScale*손절틱수,PointStop);
SetStopProfittarget(PriceScale*익절틱수,PointStop);
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 안녕하세요
> 매매시간 오전10시16분부터오후5시까지
매수조건
5 이평이 20 이평 골드크로스 매수
매도조건
5 이평이 20 이평 데드크로스 매도
당일 순이익이 100 틱 이면 매매정지
당일 순손실이 -100 틱이면 매매정지
손절 50 틱
익절 150 틱
매매중 수익이 50 틱이상 갓다가 수익이20 틱아래로내려오면 강제청산후 다음신호대기