트레이드스테이션용 수식입니다. 제가 챗GPT이용해서 전환해서 예트 적용하니 오류가 넘 많네요 ㅠㅜ. 예트용으로 전환 부탁드립니다.
// === 이동 평균 계산 ===
AA = Average(Close, XX);
BB = Average(Close, XX * XXX);
// === 진입 로직 ===
If MarketPosition = 0 then begin
If AA[1] < BB[1] and AA > BB[1] then begin
Buy ("LongEntry") YYY shares next bar at market;
EntryLow = Lowest(Low, 10);
EntryHigh = Highest(High, 10);
end;
If AA[1] > BB[1] and AA < BB[1] then begin
SellShort ("ShortEntry") YYY shares next bar at market;
EntryLow = Lowest(Low, 10);
EntryHigh = Highest(High, 10);
end;
end;
// === 청산 로직 (이동 평균 크로스오버) ===
// If MarketPosition = 1 and AA[1] > BB[1] and AA < BB[1] then
// Sell ("LongExit") next bar at market;
// If MarketPosition = -1 and AA[1] < BB[1] and AA > BB[1] then
// BuyToCover ("ShortExit") next bar at market;
답변 1
예스스탁
예스스탁 답변
2025-06-13 13:21:20
안녕하세요
예스스탁입니다.
input : XX(5),XXX(4),YYY(1);
var : AA(0),BB(0),EntryLow(0),Entryhigh(0);
// === 이동 평균 계산 ===
AA = ma(Close, XX);
BB = ma(Close, XX * XXX);
// === 진입 로직 ===
If MarketPosition == 0 then
begin
If AA[1] < BB[1] and AA > BB[1] then
begin
Buy ("LongEntry",AtMarket,def,YYY);
EntryLow = Lowest(Low, 10);
EntryHigh = Highest(High, 10);
end;
If AA[1] > BB[1] and AA < BB[1] then
begin
Sell("ShortEntry",AtMarket,Def,YYY);
EntryLow = Lowest(Low, 10);
EntryHigh = Highest(High, 10);
end;
end;
// === 청산 로직 (이동 평균 크로스오버) ===
If MarketPosition == 1 and AA[1] > BB[1] and AA < BB[1] then
ExitLong("LongExit",AtMarket);
If MarketPosition == -1 and AA[1] < BB[1] and AA > BB[1] then
ExitShort("ShortExit",AtMarket);
즐거운 하루되세요
> 라모 님이 쓴 글입니다.
> 제목 : 수식 전환 부탁드립니다~
> 트레이드스테이션용 수식입니다. 제가 챗GPT이용해서 전환해서 예트 적용하니 오류가 넘 많네요 ㅠㅜ. 예트용으로 전환 부탁드립니다.
// === 이동 평균 계산 ===
AA = Average(Close, XX);
BB = Average(Close, XX * XXX);
// === 진입 로직 ===
If MarketPosition = 0 then begin
If AA[1] < BB[1] and AA > BB[1] then begin
Buy ("LongEntry") YYY shares next bar at market;
EntryLow = Lowest(Low, 10);
EntryHigh = Highest(High, 10);
end;
If AA[1] > BB[1] and AA < BB[1] then begin
SellShort ("ShortEntry") YYY shares next bar at market;
EntryLow = Lowest(Low, 10);
EntryHigh = Highest(High, 10);
end;
end;
// === 청산 로직 (이동 평균 크로스오버) ===
// If MarketPosition = 1 and AA[1] > BB[1] and AA < BB[1] then
// Sell ("LongExit") next bar at market;
// If MarketPosition = -1 and AA[1] < BB[1] and AA > BB[1] then
// BuyToCover ("ShortExit") next bar at market;