Tarea técnica
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)
Han respondido
1
Evaluación
Proyectos
50
18%
Arbitraje
5
40%
/
40%
Caducado
0
Libre
2
Evaluación
Proyectos
44
32%
Arbitraje
6
17%
/
33%
Caducado
8
18%
Trabaja
3
Evaluación
Proyectos
40
10%
Arbitraje
0
Caducado
0
Libre
4
Evaluación
Proyectos
186
73%
Arbitraje
4
100%
/
0%
Caducado
1
1%
Libre
5
Evaluación
Proyectos
14
29%
Arbitraje
3
67%
/
33%
Caducado
0
Libre
6
Evaluación
Proyectos
62
8%
Arbitraje
12
58%
/
42%
Caducado
1
2%
Libre
7
Evaluación
Proyectos
4
50%
Arbitraje
4
0%
/
75%
Caducado
0
Libre
8
Evaluación
Proyectos
109
25%
Arbitraje
9
44%
/
22%
Caducado
8
7%
Trabaja
9
Evaluación
Proyectos
641
41%
Arbitraje
21
57%
/
29%
Caducado
47
7%
Trabaja
Solicitudes similares
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 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
Next Candle Probability
50 - 150 USD
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
An update to a ATAS Bot needed!
30 - 40 USD
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
Información sobre el proyecto
Presupuesto
30 USD
Para el ejecutor
27
- 27
USD