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
Оценка
(36)
Проекты
44
32%
Арбитраж
6
17% / 33%
Просрочено
8
18%
Работает
3
Разработчик 3
Оценка
(39)
Проекты
40
10%
Арбитраж
0
Просрочено
0
Свободен
4
Разработчик 4
Оценка
(61)
Проекты
186
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
Оценка
(87)
Проекты
109
25%
Арбитраж
9
44% / 22%
Просрочено
8
7%
Работает
9
Разработчик 9
Оценка
(568)
Проекты
641
41%
Арбитраж
21
57% / 29%
Просрочено
47
7%
Работает
Похожие заказы
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function (A) Add Transform combine the 4 Expert Advisors into just 1 Expert Advisor, maintaining the individuality of each one Leave in extern (false) or (true)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: function (A) Add Transform combine the 4 Expert Advisors into just 1 Expert Advisor, maintaining the individuality of each one Leave in extern (false) or (true)
Hello I need a very simple indicator This indicator should show the highest floating or history drawdown of the account It means that it can display the highest number that the account drawdown to be displayed on the chart in this format max drawdown account(xxxx$$) ...date(00/00/00)time:(00:00) max drawdown currency ..( currency name with max drwadown) . (xxxx$$) date(00/00/00)time:(00:00) thanks
Hello The EA will work on particular zone choose by the user and can mark it on any TF and with some rules can open trades and mange the trade by some unique rules. the EA need to check the difference by RSI as well and with some extra rules . developer should have good attitude and good communication (englsih) with high performence and knowledge with coding EA. THREE TYPES OF ENTRIES 1: AGGRESSIVE 2: DIVERGENCE 3
I want to create an EA that can take bids according to information of a logic I have developed to give indication of a BUY or SELL opportunity. The EA will then be able to activate the BUY at the lowest possible position once the indicator clears it for a BUY and take bid upwards or identify the highest point and clears it for a SELL and take bids downwards. As you can see from example of JULY 2024 data to see how
Hello, I‘m interested in an indicator to predict the next candles probability (bullish or bearish). But honestly I have no idea how to do this. Would be interested in your opinion how we can create such an indicator. Please let me know if you‘ve done similar work
Profitable EA HFT 50 - 300 USD
From a long time i am searching for a profitable EA i have lost a lot , and now i have only 300$ to buy a profitable EA , i wish to say with 0 losses but some or most traders they don't want to hear this i am really tired of searching for a programmer to just create me a profitable EA with the least losses or zero losses maybe nearly 1 year i am searching i just need an HFT EA that can work very well on MT4,MT5
у нас есть стратегия, нам нужно написать mql5-код ​​для тестера стратегий МТ5,Цена договорная. Мой контакт @abbosaliyev из Telegram Программист должен знать РУССКИЙ ИЛИ УЗБЕКСКИЙ язык. Задание: разработать тестер, который использует шаблон условий на открытие и проверит весь исторический график на всех доступных таймфреймах. Остальная информация будет предоставлена ​​после согласования цены
Hello, I want to make an EA based on SMC and a developer that is familiar with the concept and full understanding of this. Must have done similar jobs before and be able show it. I only want to work with developer that has good track record and is precise. Further information will be handed when contact is made. Developers that has zero rating will not be considered. Listed price is a base point. The project can also
Hello there! I have a ATAS bot that would be discussed properly with you once you bid to this project, But majorly what i need is either: An update to my bot that allows it to watch one chart and trade on another within ATAS. Or an add on of some kind that allows it to watch one ATAS chart and then communicate with a bot that can execute trades in MT4/5. Bid now for more proper details

Информация о проекте

Бюджет
30 USD
Исполнителю
27 - 27 USD