Expert baseado em EMA, MACD, e RSI

MQL4 전문가 Forex

명시

importar pandas como pd
importar numpy como np
importar talib

# Obtendo os dados do gráfico de 5 minutos (substitua com seus próprios dados)
data = pd.read_csv('seu_arquivo_de_dados.csv')

# Parâmetros dos indicadores
ema_short_period = 9
ema_long_period = 21
rsi_threshold = 50
stop_loss = 0.02 # Exemplo: 2% de perda

# Calculando os indicadores
data['ema_short'] = talib.EMA(data['close'], timeperiod=ema_short_period)
data['ema_long'] = talib.EMA(data['close'], timeperiod=ema_long_period)
data['macd_line'], _, data['macd_signal'] = talib.MACD(data['close'])
dados['rsi'] = talib.RSI(dados['fechar'])

# Função para verificar se há tendência de alta
def tendência de alta(df):
    return df['ema_short'] > df['ema_long'] e df['macd_line'] > df['macd_signal'] e df['rsi'] > rsi_threshold

# Função para verificar se há tendência de baixa
def tendência de baixa(df):
    return df['ema_short'] < df['ema_long'] e df['macd_line'] < df['macd_signal'] e df['rsi'] < rsi_threshold

# Variáveis ​​para controle de posição, take profit e stop loss
posição = Nenhuma
take_profit = 0.02 # Exemplo: 2% de lucro

# Aplicando a estratégia aos dados
data['decisão'] = 'Esperar'

para i no intervalo(len(dados)):
    se a posição for None: # Sem posição aberta
        se tendência de alta(data.loc[i]):
            posição = {
                'entry_price': dados['fechar'][i],
                'take_profit': data['close'][i] * (1 + take_profit),
                'stop_loss': data['close'][i] * (1 - stop_loss)
            }
            data.at[i, 'decisão'] = "Comprar"
            print("Ordem de compra aberta:", position['entry_price'])
        elif tendência de baixa(data.loc[i]):
            posição = {
                'entry_price': dados['fechar'][i],
                'take_profit': data['close'][i] * (1 - take_profit),
                'stop_loss': data['close'][i] * (1 + stop_loss)
            }
            data.at[i, 'decisão'] = "Vendedor"
            print("Ordem de venda aberta:", position['entry_price'])
    else: # Posição aberta
        se (
            (data['close'][i] >= position['stop_loss'] e data['decision'][i] == "Comprar") ou
            (data['close'][i] <= position['stop_loss'] and data['decision'][i] == "Vender")
        ):
            print("Ordem encerrada:", data['close'][i])
            posição = Nenhuma

# Exibindo as decisões de negociação

print(dados[['data', 'fechar', 'decisão']])


banca = 10000 # Exemplo: valor da sua banca em dólares

percentual_lote = 0.1 # Exemplo: 10% da banca


# Função para calcular o tamanho do lote com base no percentual da banca

def calcular_tamanho_lote(banca):

    return banca * percentual_lote


# Exemplo de uso

tamanho_lote = calcular_tamanho_lote(banca)

print("Tamanho do lote:", tamanho_lote)



응답함

1
개발자 1
등급
(39)
프로젝트
50
18%
중재
5
40% / 40%
기한 초과
0
무료
2
개발자 2
등급
(37)
프로젝트
45
33%
중재
6
17% / 33%
기한 초과
8
18%
작업중
3
개발자 3
등급
(39)
프로젝트
40
10%
중재
0
기한 초과
0
무료
4
개발자 4
등급
(63)
프로젝트
194
73%
중재
4
100% / 0%
기한 초과
1
1%
무료
5
개발자 5
등급
(11)
프로젝트
14
29%
중재
3
67% / 33%
기한 초과
0
무료
6
개발자 6
등급
(42)
프로젝트
62
8%
중재
12
58% / 42%
기한 초과
1
2%
무료
7
개발자 7
등급
(5)
프로젝트
4
50%
중재
4
0% / 75%
기한 초과
0
무료
8
개발자 8
등급
(89)
프로젝트
112
24%
중재
11
45% / 18%
기한 초과
8
7%
작업중
9
개발자 9
등급
(568)
프로젝트
641
41%
중재
21
57% / 29%
기한 초과
47
7%
작업중
비슷한 주문
I have a indicator, mql file. The signals are seen below on a EURNZD H1 chart. Very important to get accurate entries. The signal to trade is the first tic after the the indicator signal paints. I've tried to demonstrate that below. Other than that the EA will have a lot size escalation, an on-screen pip counter, a button to stop taking new trades, SL/TP, and magic number. I would like the indicator to be within the
I would like to create an EA based on the Shved Supply and Demand indicator. you can find the Shved Supply and Demand v1.7 indicator in the following link https://www.mql5.com/en/code/29395 NB: Checks the trading robot must pass before publication in the Market ( https://www.mql5.com/en/articles/2555 ) MQ5 file to be provided
Hi Guys, I am looking to someone that can generate an indicator for MT4 as explained below. Basically I would need that the indicator point out the price that will close my position in stop out/margin call. The indicator should pick automatically the level of trade out for the broker (which can be different from a broker to another broker) It should write (ideally on the bottom on the left) the following information
Mbeje fx 50+ USD
I like to own my robot that why I want to build my own.i like to be a best to every robot ever in the life to be have more money
I need an MT5 EA that can do the following: I have to give the EA a price in advance, when the price is reached the EA has to automatically place a buy stop or sell stop order 0.5 pips below or above the price. Is this possible
Good day, I want someone to help me create a universal news filter with on/off switch, with start and end settings, and drawdown control with magic number of EAs, etc. Thanks
Hello, I am looking for a professional programmer to optimize my existing EA integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. i want it to be an EA that can be trusted to carry trade with the help of chat gpt and also have a very low drawdown
Hello, I am looking for a professional programmer to create a trading expert on the MT4 platform, integrating it with ChatGPT to analyze currencies using various methods to make the right trading decisions. Further details will be provided to the applicants later
I am looking for an experienced MQL5 developer to help me finalize and optimize an Expert Advisor (EA) for the FTMO challenge. I have already built a significant portion of the code, but it requires further refinement and optimization to ensure it functions according to the trading strategy I intend to use. I am happy to share all the resources, including the current code, reference materials, and detailed
dreams good and have a great Cash out from your smart phone , tuyoywuiy glamorous flood see full idk idk slow so dolls stupid sis workouts who's spark koalas oral waits also doggo idk

프로젝트 정보

예산
30 USD
개발자에게
27 - 27 USD