답변완료
다시 질문 좀 드립니다.
87857번 다시 질문 드려봅니다.
if Tcond == true and Trade == true Then
{
if MarketPosition <= 0 and 조건1+조건2+조건3+조건4 then
Buy("b2",OnClosE,DeF,진입수량2);
If MarketPosition <= 0 and 조건1+조건2+조건3+조건5
Buy("b3",OnClosE,DeF,진입수량1);
if MarketPosition <= 0 and 조건1+조건2+조건3
Buy("b",OnClosE,DeF,진입수량1);
if MarketPosition == 1 and IsEntryName("b3") == true and MaxContracts == 1 Then
{
if 조건1+조건2+조건3+조건4
Buy("b4",OnClosE,DeF,진입수량1);
}
}
알려주신 대로 수정하였더니 “b4”가 진입이 안되고 “b2”+“b”가 동시에 3계약 진입해 버립니다. “B”진입식 위에 else를 삽입하면 “b4”가 진입은 되는데 역시 . “b2”+“b”가 동시에 3계약 진입해 버립니다.
요청사항은
“b2”가 진입되면 “b”은 진입 안되게 하면서, “b4”진입조건이 되면 “b4”가 진입할 수 있게 변경 좀 부탁드립니다.(최대 보유포지션 2계약)
2024-06-26
741
글번호 180974
시스템
답변완료
지표 부탁합니다
예스에서 Chaikin Money Flow (CMF)을 구현할 수 있는지요?
1.자금 흐름 승수 (MFM):
MFM = (종가−저가)−(고가−종가)/고가−저가
2.자금 흐름 거래량 (MFV):
MFV = MFM ×거래량
3. CMF:
첨부 파일 참조
​ 여기서 𝑁 은 기간 (보통 20 또는 21일)입니다.
해석:
CMF > 0: 매수 압력이 우세한 축적을 나타냅니다.
CMF < 0: 매도 압력이 우세한 분배를 나타냅니다.
참고로 CMF를 계산하는 Python 코드입니다
import pandas as pd
# 예제 데이터프레임: ['고가', '저가', '종가', '거래량']
data = {
'High': [125, 127, 130, 128, 131],
'Low': [120, 122, 123, 124, 126],
'Close': [124, 126, 129, 127, 130],
'Volume': [1000, 1100, 1200, 1300, 1400]
}
df = pd.DataFrame(data)
# 자금 흐름 승수 계산
df['MFM'] = ((df['Close'] - df['Low']) - (df['High'] - df['Close'])) / (df['High'] - df['Low'])
# 자금 흐름 거래량 계산
df['MFV'] = df['MFM'] * df['Volume']
# 3일 기간 동안의 Chaikin Money Flow 계산 (예제)
cmf_period = 3
df['CMF'] = df['MFV'].rolling(window=cmf_period).sum() / df['Volume'].rolling(window=cmf_period).sum()
print(df[['High', 'Low', 'Close', 'Volume', 'MFM', 'MFV', 'CMF']])
2024-06-26
843
글번호 180973
지표
답변완료
수식수정
아래는 어제 작성해주신 수식입니다.
여기에 1봉전에 200이평(단순)돌파(가격/물량조건 추가)를 or로 추가하고 싶습니다.
A=avg(c,200);
Crossup(C, A) and C>C(1)*1.05 and
((V>V(1)*5) or (V(1)>V(2)*5))
즉,
- 1봉전에 RSI(20)<64에서 200이평돌파(가격/물량조건 추가) or 아래(13지수이평이
선형스팬기준선돌파)가 발생,
- and 0봉전 RSI(20)>64
마지막으로 부탁드립니다.
==========================================================================
INPUT : shortPeriod(9),midPeriod(26),longPeriod(52),이평(13),RSIP(20);
VAR : 선행1(0),선행2(0),고점(0),저점(0),A(0),B(0),R(0);
선행1=(highest(high,shortPeriod)+lowest(low,shortPeriod)+highest(high,midPeriod)+lowest(low,midPeriod))/4;
선행2=(highest(high,longPeriod)+lowest(low,longPeriod))/2;
고점 = Highest(선행1,25);
저점 = lowest(선행1,25);
IF 선행1<선행2 TheN
A=저점;
B = EMA(C, 이평);
Condition1 = CrossUp(B,A);
R = RSI(RSIP);
IF Condition1[1] == true and R[1] < 64 and R > 64 TheN
Find(1);
2024-06-26
950
글번호 180971
종목검색
답변완료
수식수정 부탁드립니다.
안녕하세요.
더위가 찾아오는 요즈음 무탈하시길 빕니다.
이번에 요청드릴 사항은 다음 수식을 수정하여 진입조건이 "ADX 값이 var1 >= 25 이면서 또한 ADX 값이 상승추세"일때 진입하며, 일목균형표 상 양의 구름대일때는 매수진입만, 음의 구름대일때는 매도만 진입되도록 부탁드립니다.
input : 거래시간 (1), 시작시간 (160000), 끝시간 (045500),익절틱수 (36),손절틱수 (15);
input : ADXP(9),CCIP1(50),CCIP2(14);
Var: HH(0), LL(0), HHH(0), LLL(0), FK(0), Condition3(false);
if 거래시간 == 1 then
condition3 = (stime>=시작시간 or stime<=끝시간 );
Else if 거래시간 == 2 then
condition3 = (stime>=시작시간 and stime<=끝시간 );
Else
condition3 = true;
var1 = adx(ADXP);
var2 = cci(CCIP1);
var3 = cci(CCIP2);
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
var1 >= 25 and (CrossUp(var2,100)) and
var3 > 0 Then
buy();
if MarketPosition == 0 and TotalTrades == TotalTrades[1] and
Condition3 == true and
var1 >= 25 and (CrossDown(var2,-100)) and
var3 < 0 Then
sell();
if MarketPosition == 1 Then{
LL = Floor((highest(H,BarsSinceEntry) - EntryPrice)/(PriceScale*손절틱수 ));
ExitLong("bx",AtStop,(EntryPrice-(PriceScale*손절틱수 ))+(PriceScale*손절틱수 )*LL);
}
if MarketPosition == -1 Then{
HH = Floor((EntryPrice-Lowest(L,BarsSinceEntry))/(PriceScale*손절틱수 ));
ExitShort("sx",AtStop,(EntryPrice+(PriceScale*손절틱수))-(PriceScale*손절틱수 )*HH);
}
SetStopProfittarget(PriceScale*익절틱수,PointStop);
if stime == 끝시간 or (stime > 끝시간 and stime[1] < 끝시간 ) Then{
if MarketPosition == 1 Then
ExitLong();
if MarketPosition == -1 Then
ExitShort();
}
#매수진입가격은 신호봉 저가-1틱
if MarketPosition == 1 and CurrentContracts > CurrentContracts[1] Then
Text_New(EntryDate,EntryTime,L[BarsSinceEntry]-PriceScale*3,NumToStr(EntryPrice,2));
#매도진입가격은 신호봉 고가+1틱
if MarketPosition == -1 and CurrentContracts > CurrentContracts[1] Then
Text_New(EntryDate,EntryTime,H[BarsSinceEntry]+PriceScale*3,NumToStr(EntryPrice,2));
#매수청산가격은 신호봉 고가+1틱
if TotalTrades > TotalTrades[1] and MarketPosition(1) == 1 Then
Text_New(ExitDate(1),Exittime(1),H[BarsSinceExit(1)]+PriceScale*3,NumToStr(ExitPrice(1),2));
#매도청산가격은 신호봉 저가-1틱
if TotalTrades > TotalTrades[1] and MarketPosition(1) == -1 Then
Text_New(ExitDate(1),Exittime(1),L[BarsSinceExit(1)]-PriceScale*3,NumToStr(ExitPrice(1),2));
2024-06-26
1073
글번호 180969
시스템
답변완료
문의 드립니다.
매수신호가 1개 봉에서 한번 발생할 수 있도록 부탁드립니다.
input : 시작일(20240501);
var1 = ma(c,1);
if MarketPosition == 0 and sdate >= 시작일 Then
Buy("b1",AtStop,var1);
if MarketPosition == 1 and sdate >= 시작일 Then
{
Buy("b2",AtLimit,EntryPrice*0.98);
Buy("b3",AtLimit,EntryPrice*0.96);
Buy("b4",AtLimit,EntryPrice*0.94);
Buy("b5",AtLimit,EntryPrice*0.93);
Buy("b6",AtLimit,EntryPrice*0.90);
Buy("b7",AtLimit,EntryPrice*0.88);
Buy("b8",AtLimit,EntryPrice*0.86);
}
SetStopProfittarget(3,PercentStop);
2024-06-26
1101
글번호 180968
시스템