예스스탁
예스스탁 답변
2024-01-03 16:48:47
안녕하세요
예스스탁입니다.
수정한 식입니다.
Inputs: Length(9), StdDev(2), Bars(2);
Input: 손절(20), 익절(40), 몇번까지(7);
Input: n1(1), n2(2), n3(3), n4(4), n5(5), n6(6), n7(12), n8(24), n9(48);
var: vol(0),s(0),x(0);
Variables: BBTop(0),BBBot(0);
BBTop = BollBandup(Length, StdDev);
BBBot = BollBanddown(Length, StdDev);
If MarketPosition == 0 and CountIF(Close < BBBot, Bars) == Bars Then
Buy("B1", AtStop, BBBot);
if MarketPosition == 0 and CountIF(Close > BBTop, Bars) == Bars Then
Sell("S1", AtStop, BBTop,n1);
if MarketPosition != 0 and MarketPosition[1] != 0 and MarketPosition != MarketPosition[1] Then
x = x+1;
if MarketPosition == 1 Then
{
if MarketPosition[1] != MarketPosition and IsEntryName("B1") == true Then
{
s = LatestEntryPrice(0);
x = 1;
}
ExitLong("bp",AtLimit,s+익절);
if x == 1 Then vol = n2;
if x == 2 Then vol = n3;
if x == 3 Then vol = n4;
if x == 4 Then vol = n5;
if x == 5 Then vol = n6;
if x == 6 Then vol = n7;
if x == 7 Then vol = n8;
if x == 8 Then vol = n9;
if x < 몇번까지 Then
sell("bs",AtStop,s-손절,vol);
}
if MarketPosition == -1 Then
{
if MarketPosition[1] != MarketPosition and IsEntryName("S1") == true Then
{
s = LatestEntryPrice(0);
x = 1;
}
ExitShort("sp",AtLimit,s-익절);
if x == 1 Then vol = n2;
if x == 2 Then vol = n3;
if x == 3 Then vol = n4;
if x == 4 Then vol = n5;
if x == 5 Then vol = n6;
if x == 6 Then vol = n7;
if x == 7 Then vol = n8;
if x == 8 Then vol = n9;
if x < 몇번까지 Then
Buy("sb",AtStop,s+손절,vol);
}
즐거운 하루되세요
> cjfdk 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 수고많으십니다
문의드릴 내용은 85211번에 도와주신 내용으로
붙여넣기 하였으나 작동이 돼지않아 재검토 부탁드립니다
항상 감사드립니다