커뮤니티
아래식에서
2017-09-19 20:23:58
104
글번호 112904
아래식에서 매매중에 손실이60틱이상이면 다음 진입은 하지않는식 부탁합니다
Input : shortPeriod(30),longPeriod(500);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
var : HH(0),LL(0);
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count < 30
Then{
if stime >= 100000 and stime < 152000 Then{
# 매수/매도청산
If CrossUP(value1, value2) Then
{
buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
sell();
}
}
}
답변 1
예스스탁 예스스탁 답변
2017-09-20 16:18:23
안녕하세요
예스스탁입니다.
Input : shortPeriod(30),longPeriod(500);
Input : 당일손실틱수(60);
var : HH(0),LL(0);
var : cnt(0),count(0);
Var : N1(0),dayPl(0),당일손실(0),Xcond(false);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
당일손실 = PriceScale*당일손실틱수;
if Bdate != Bdate[1] Then{
Xcond = false;
N1 = NetProfit;
}
daypl = NetProfit-N1;
if TotalTrades > TotalTrades[1] and
(IsExitName("dbl",1) == true or IsExitName("dsl",1) == true) then
Xcond = true;
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count < 30 and Xcond == false Then
{
if stime >= 100000 and stime < 152000 Then
{
If CrossUP(value1, value2) Then
{
buy();
}
If CrossDown(value1, value2) Then
{
sell();
}
}
}
if MarketPosition == 1 then{
ExitLong("dbl",AtStop,EntryPrice-((당일손실+daypl)/CurrentContracts));
}
if MarketPosition == -1 then{
ExitShort("dsl",AtStop,EntryPrice+((당일손실+daypl)/CurrentContracts));
}
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 아래식에서
> 아래식에서 매매중에 손실이60틱이상이면 다음 진입은 하지않는식 부탁합니다
Input : shortPeriod(30),longPeriod(500);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
var : HH(0),LL(0);
var : cnt(0),count(0);
count = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
count = count+1;
}
if count < 30
Then{
if stime >= 100000 and stime < 152000 Then{
# 매수/매도청산
If CrossUP(value1, value2) Then
{
buy();
}
# 매도/매수청산
If CrossDown(value1, value2) Then
{
sell();
}
}
}
다음글
이전글