커뮤니티
아래식에서
2017-10-03 12:04:06
103
글번호 113237
아래식에서 당일수익이 100틱이상이면 당일거래중지식 부탁드립니다
Input : shortPeriod(30),longPeriod(500);
Input : 당일손실틱수(100);
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 < 160000 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));
}
SetStopLoss(PriceScale*400,PointStop);
SetStopProfittarget(PriceScale*50,PointStop);
답변 1
예스스탁 예스스탁 답변
2017-10-10 17:45:50
안녕하세요
예스스탁입니다.
Input : shortPeriod(30),longPeriod(500);
Input : 당일손실틱수(100), 당일수익틱수(100);
var : HH(0),LL(0);
var : cnt(0),count(0);
Var : N1(0),dayPl(0),당일손실(0),당일수익(0),Xcond(false);
value1 = ma(C, shortPeriod);
value2 = ma(C, longPeriod);
당일손실 = PriceScale*당일손실틱수;
당일수익 = PriceScale*당일수익틱수;
if Bdate != Bdate[1] Then{
Xcond = false;
N1 = NetProfit;
}
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;
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 < 160000 Then
{
If CrossUP(value1, value2) Then
{
buy();
}
If CrossDown(value1, value2) Then
{
sell();
}
}
}
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));
}
즐거운 하루되세요
> 수원 님이 쓴 글입니다.
> 제목 : 아래식에서
> 아래식에서 당일수익이 100틱이상이면 당일거래중지식 부탁드립니다
Input : shortPeriod(30),longPeriod(500);
Input : 당일손실틱수(100);
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 < 160000 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));
}
SetStopLoss(PriceScale*400,PointStop);
SetStopProfittarget(PriceScale*50,PointStop);
다음글
이전글