Техническое задание
import pandas as pd
import numpy as np
def generate_signals(data):
signals = pd.DataFrame(index=data.index)
signals['price'] = data['Close']
# Calculate moving averages
signals['short_ma'] = data['Close'].rolling(window=20, min_periods=1).mean()
signals['long_ma'] = data['Close'].rolling(window=50, min_periods=1).mean()
# Generate buy signals
signals['buy_signal'] = np.where(signals['short_ma'] > signals['long_ma'], 1, 0)
# Generate sell signals
signals['sell_signal'] = np.where(signals['short_ma'] < signals['long_ma'], -1, 0)
return signals
def backtest_strategy(signals, initial_capital=10000):
positions = pd.DataFrame(index=signals.index).fillna(0.0)
positions['asset'] = 1000 * signals['buy_signal'] + -1000 * signals['sell_signal']
# Calculate portfolio value
portfolio = positions.multiply(signals['price'], axis=0)
pos_diff = positions.diff()
portfolio['holdings'] = (positions.multiply(signals['price'], axis=0)).sum(axis=1)
portfolio['cash'] = initial_capital - (pos_diff.multiply(signals['price'], axis=0)).sum(axis=1).cumsum()
portfolio['total'] = portfolio['cash'] + portfolio['holdings']
portfolio['returns'] = portfolio['total'].pct_change()
return portfolio
# Example usage:
# Assuming 'data' is a DataFrame containing historical price data with 'Date' as index and 'Close' as a column
# signals = generate_signals(data)
# portfolio = backtest_strategy(signals)
# print(portfolio.tail())
Откликнулись
1
Оценка
Проекты
373
72%
Арбитраж
19
32%
/
47%
Просрочено
14
4%
Свободен
Опубликовал: 14 примеров
2
Оценка
Проекты
460
26%
Арбитраж
140
20%
/
59%
Просрочено
100
22%
Работает
3
Оценка
Проекты
475
40%
Арбитраж
105
40%
/
24%
Просрочено
80
17%
Занят
Опубликовал: 2 примера
Похожие заказы
Looking for a Scalping bot, it Must be on MT5, Takes many trades , Any strategy is fine, Has to be profitable last 3 months backtest, Send me a demo license file to check it's performance
I hope to acquire a profitable and existing expert advisor (EA) from the gold market, with complete source code, to add to our client portfolio. you can WECHAT: Faca7898 Please note EA when adding friends. It should be clarified that this does not require you to formulate or design new strategies. If you already have a verified, consistent, and production-ready EA, I am willing to purchase it immediately and engage
I’m looking for an experienced developer to help build a trading bot for Polymarket , focused on short-term crypto prediction markets (e.g. 5–15 minute intervals). The strategy is fully rule-based and operates on binary outcome markets (YES/NO shares). The bot should be able to: monitor live market prices and probabilities, execute trades based on predefined conditions, manage positions dynamically before market
MT4 TMA Reference
30+ USD
Eu preciso disso. A linha central do TMA (17,5,1.5) será a principal referência. Outra linha de média móvel (AVG) de 3 períodos decrescentes 2. As ordens serão as seguintes: abaixo, somente compra de TMA; acima, somente venda de TMA. O sinal de entrada será o seguinte: se o preço estiver acima da Média Móvel Tarifária (TMA), será apenas para venda; quando o preço se mantiver abaixo da Média Móvel Tarifária (AVG)
Hola, estoy buscando un desarrollador MQL5 con experiencia real en trading algorítmico. Necesito un EA para XAUUSD con: Control de Drawdown filtro de mercado (tendencia vs rango) gestión de riesgo dinámica optimización para sesiones específicas Antes de avanzar quisiera saber: ¿Qué experiencia tienes con EAs en MT5? ¿Has trabajado con estrategias de oro (XAUUSD)? ¿Cómo gestionas el drawdown en un bot? ¿Puedes mostrar
Double ma
30+ USD
Create an EA on moving averages. The EA will open a trade when the price is above the averages. It will open another when it is below the averages. Ability to work on any timeframe. Ability to use a news filter and a martingale...or to work on a grid
There is a programming god without EA here. I want to find someone to make an EA to operate gold and silver. There is a model, but it can't run. So I want to find someone to make professional improvements to make my EA run. If you are interested, you can WECHAT: 15113958263. Please note EA when adding friends
Robots in C++ (cAlgo trading platform)
30 - 80 USD
Iam seeking for a good trade robot/indicator debugging developer to finalize and close profits for me,in both my exneas blocker and MT5,for expert advisor for trading both gold xausd and sliver xagusd,l really want a perfect robot that can herence and risk management principles,not to leave out am a beginner
Non-repainting Indicator for scalping Gold / Xauusd
30 - 200 USD
I am looking for non-repainting indicator to run in all sessions for scalping gold , happy to discuss if you have developed such indicators which can show profit and stop loss levels
Hello! I want to buy two indicators: A Support and Resistence Indicator and a Trendline Indicator. Support and Resistence Indicators needs to automatically draws Support and Resistance lines based on High and Low Candle in every time-frame (If possible time-frame needs to be in inputs and choose by me what time-frame i want indicator to draw lines) Trendline Indicator needs to automatically draws Trendline Channels
Информация о проекте
Бюджет
30 - 50 USD
Сроки выполнения
от 1 до 14 дн.