예스스탁
예스스탁 답변
2024-08-01 14:33:22
안녕하세요
예스스탁입니다.
조건지정이 잘못된 부분이 있어 수정했습니다.
1
input : jawLength(13),jawOffset(8);
input : teethLength(8),teethOffset(5);
input : lipsLength(5),lipsOffset(3);
Input : 당일수익틱수(100),당일손실틱수(100);
var : hl2(0),jaw(0),teeth(0),lips(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0);
var : Tcond(false),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
}
hl2 = (h+l)/2;
jaw = 0;
if IsNaN(jaw[1]) == true Then
jaw = ma(hl2,jawLength);
Else
jaw = (jaw[1]*(jawLength-1) + hl2)/jawLength;
teeth = 0;
if IsNaN(teeth[1]) == true Then
teeth = ma(hl2,teethLength);
Else
teeth = (teeth[1]*(teethLength-1) + hl2)/teethLength;
lips = 0;
if IsNaN(lips[1]) == true Then
lips = ma(hl2,lipsLength);
Else
lips = (lips[1]*(lipsLength-1) + hl2)/lipsLength;
Condition1 = jaw[jawOffset] > teeth[teethOffset] and teeth[teethOffset] > lips[lipsOffset];
Condition2 = jaw[jawOffset] < teeth[teethOffset] and teeth[teethOffset] < lips[lipsOffset];
if Xcond == False then
{
if Condition1 == true and Condition1[1] == False Then
Buy();
if Condition2 == true and Condition2[1] == False 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));
}
2
input : jawLength(13),jawOffset(8);
input : teethLength(8),teethOffset(5);
input : lipsLength(5),lipsOffset(3);
Input : 당일수익틱수(100),당일손실틱수(100);
var : hl2(0),jaw(0),teeth(0),lips(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0);
var : Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
}
hl2 = (h+l)/2;
jaw = 0;
if IsNaN(jaw[1]) == true Then
jaw = ma(hl2,jawLength);
Else
jaw = (jaw[1]*(jawLength-1) + hl2)/jawLength;
teeth = 0;
if IsNaN(teeth[1]) == true Then
teeth = ma(hl2,teethLength);
Else
teeth = (teeth[1]*(teethLength-1) + hl2)/teethLength;
lips = 0;
if IsNaN(lips[1]) == true Then
lips = ma(hl2,lipsLength);
Else
lips = (lips[1]*(lipsLength-1) + hl2)/lipsLength;
if Xcond == False then
{
if CrossUp(lips[lipsOffset],teeth[teethOffset]) Then
Buy();
if CrossDown(lips[lipsOffset],teeth[teethOffset]) 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));
}
즐거운 하루되세요
> cjfdk 님이 쓴 글입니다.
> 제목 : 문의드립니다
>
1
input : jawLength(13),jawOffset(8);
input : teethLength(8),teethOffset(5);
input : lipsLength(5),lipsOffset(3);
Input : 당일수익틱수(100),당일손실틱수(100);
var : hl2(0),jaw(0),teeth(0),lips(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0);
var : Tcond(false),Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
}
hl2 = (h+l)/2;
jaw = 0;
if IsNaN(jaw[1]) == true Then
jaw = ma(hl2,jawLength);
Else
jaw = (jaw[1]*(jawLength-1) + hl2)/jawLength;
teeth = 0;
if IsNaN(teeth[1]) == true Then
teeth = ma(hl2,teethLength);
Else
teeth = (teeth[1]*(teethLength-1) + hl2)/teethLength;
lips = 0;
if IsNaN(lips[1]) == true Then
lips = ma(hl2,lipsLength);
Else
lips = (lips[1]*(lipsLength-1) + hl2)/lipsLength;
Condition1 = jaw[jawOffset] > teeth[teethOffset] and teeth[teethOffset] > lips[lipsOffset];
Condition2 = jaw[jawOffset] < teeth[teethOffset] and teeth[teethOffset] < lips[lipsOffset];
if Xcond == true then
{
if Condition1 == true and Condition1[1] == False Then
Buy();
if Condition2 == true and Condition2[1] == False 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));
}
2
input : jawLength(13),jawOffset(8);
input : teethLength(8),teethOffset(5);
input : lipsLength(5),lipsOffset(3);
Input : 당일수익틱수(100),당일손실틱수(100);
var : hl2(0),jaw(0),teeth(0),lips(0);
Var : N1(0),dayPl(0),당일수익(0),당일손실(0);
var : Xcond(false);
당일수익 = PriceScale*당일수익틱수;
당일손실 = PriceScale*당일손실틱수;
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;
}
hl2 = (h+l)/2;
jaw = 0;
if IsNaN(jaw[1]) == true Then
jaw = ma(hl2,jawLength);
Else
jaw = (jaw[1]*(jawLength-1) + hl2)/jawLength;
teeth = 0;
if IsNaN(teeth[1]) == true Then
teeth = ma(hl2,teethLength);
Else
teeth = (teeth[1]*(teethLength-1) + hl2)/teethLength;
lips = 0;
if IsNaN(lips[1]) == true Then
lips = ma(hl2,lipsLength);
Else
lips = (lips[1]*(lipsLength-1) + hl2)/lipsLength;
if Xcond == true then
{
if CrossUp(lips[lipsOffset],teeth[teethOffset]) Then
Buy();
if CrossDown(lips[lipsOffset],teeth[teethOffset]) 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));
}
수고 많으십니다
문의드릴 내용은 위 수식은
88382번 문의 내용에 대해 작성해 주신 수식인데요
적용해보니 거래가 발생하지 않아
한번 더 검토 부탁드립니다
항상 감사드립니다