커뮤니티
수식문의
2018-11-01 09:53:21
173
글번호 123254
안녕하세요
하기 A번 수식하고 B번 수식을 같이 사용하게 부탁드립니다.
제가 프로그램에 익숙하지 못해서 죄송합니다.
A.
Input : Period(20), MultiD(2);
var : BBmd(0),BBup(0),BBdn(0);
BBmd = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
if MarketPosition >= 0 and
C[1] >= O[1] and H[1] >= BBup[1] and BBup[1] >= L[1] and
C < O and abs(C-O) > abs(C[1]-O[1]) Then
sell("s1");
if MarketPosition <= 0 and
C[1] <= O[1] and H[1] >= BBdn[1] and BBdn[1] >= L[1] and
C > O and abs(C-O) > abs(C[1]-O[1]) Then
Buy("b1");
if MarketPosition == 1 Then
{
exitlong("bx1",AtLimit,EntryPrice+PriceScale*30,"",max(1,floor(MaxContracts*0.5)),1);
exitlong("bx2",AtLimit,EntryPrice+PriceScale*50);
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,EntryPrice-PriceScale*30,"",max(1,floor(MaxContracts*0.5)),1);
ExitShort("sx2",AtLimit,EntryPrice-PriceScale*50);
}
B.
value1 = MACD(short, long);
value2 = ema(value1, Period);
# 매수/매도청산
If CrossUP(value1, value2) and C <= bbmd-PriceScale*10 Then
{
buy("b2");
}
# 매도/매수청산
If CrossDown(value1, value2) and C >= bbmd+PriceScale*10 Then
{
sell("s2");
}
감사합니다.
답변 1
예스스탁 예스스탁 답변
2018-11-01 16:03:35
안녕하세요
예스스탁입니다.
Input : Period(20), MultiD(2);
input : short(12),long(26),sig(9);
var : BBmd(0),BBup(0),BBdn(0);
BBmd = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
value1 = MACD(short, long);
value2 = ema(value1, Period);
if MarketPosition >= 0 and
C[1] >= O[1] and H[1] >= BBup[1] and BBup[1] >= L[1] and
C < O and abs(C-O) > abs(C[1]-O[1]) Then
sell("s1");
if MarketPosition <= 0 and
C[1] <= O[1] and H[1] >= BBdn[1] and BBdn[1] >= L[1] and
C > O and abs(C-O) > abs(C[1]-O[1]) Then
Buy("b1");
# 매수/매도청산
If CrossUP(value1, value2) and C <= bbmd-PriceScale*10 Then
{
buy("b2");
}
# 매도/매수청산
If CrossDown(value1, value2) and C >= bbmd+PriceScale*10 Then
{
sell("s2");
}
if MarketPosition == 1 Then
{
exitlong("bx1",AtLimit,EntryPrice+PriceScale*30,"",max(1,floor(MaxContracts*0.5)),1);
exitlong("bx2",AtLimit,EntryPrice+PriceScale*50);
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,EntryPrice-PriceScale*30,"",max(1,floor(MaxContracts*0.5)),1);
ExitShort("sx2",AtLimit,EntryPrice-PriceScale*50);
}
즐거운 하루되세요
> softtoug 님이 쓴 글입니다.
> 제목 : 수식문의
> 안녕하세요
하기 A번 수식하고 B번 수식을 같이 사용하게 부탁드립니다.
제가 프로그램에 익숙하지 못해서 죄송합니다.
A.
Input : Period(20), MultiD(2);
var : BBmd(0),BBup(0),BBdn(0);
BBmd = ma(C,Period);
BBup = BollBandUp(Period,MultiD);
BBdn = BollBandDown(Period,MultiD);
if MarketPosition >= 0 and
C[1] >= O[1] and H[1] >= BBup[1] and BBup[1] >= L[1] and
C < O and abs(C-O) > abs(C[1]-O[1]) Then
sell("s1");
if MarketPosition <= 0 and
C[1] <= O[1] and H[1] >= BBdn[1] and BBdn[1] >= L[1] and
C > O and abs(C-O) > abs(C[1]-O[1]) Then
Buy("b1");
if MarketPosition == 1 Then
{
exitlong("bx1",AtLimit,EntryPrice+PriceScale*30,"",max(1,floor(MaxContracts*0.5)),1);
exitlong("bx2",AtLimit,EntryPrice+PriceScale*50);
}
if MarketPosition == -1 Then
{
ExitShort("sx1",AtLimit,EntryPrice-PriceScale*30,"",max(1,floor(MaxContracts*0.5)),1);
ExitShort("sx2",AtLimit,EntryPrice-PriceScale*50);
}
B.
value1 = MACD(short, long);
value2 = ema(value1, Period);
# 매수/매도청산
If CrossUP(value1, value2) and C <= bbmd-PriceScale*10 Then
{
buy("b2");
}
# 매도/매수청산
If CrossDown(value1, value2) and C >= bbmd+PriceScale*10 Then
{
sell("s2");
}
감사합니다.