Spezifikation

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())

Bewerbungen

1
Entwickler 1
Bewertung
(278)
Projekte
374
72%
Schlichtung
19
32% / 47%
Frist nicht eingehalten
14
4%
Frei
Veröffentlicht: 14 Beispiele
2
Entwickler 2
Bewertung
(250)
Projekte
460
26%
Schlichtung
140
20% / 59%
Frist nicht eingehalten
100
22%
Arbeitet
3
Entwickler 3
Bewertung
(298)
Projekte
477
40%
Schlichtung
105
40% / 24%
Frist nicht eingehalten
81
17%
Beschäftigt
Veröffentlicht: 2 Beispiele
Ähnliche Aufträge
Project Overview We have a highly optimized, production-ready custom cTrader cBot built for a fast-paced Renko breakout strategy (specifically trading XAUUSD/Gold). The core system architecture, structural mapping, and breakout logic are flawless. We are seeking an expert C# algorithmic developer for a targeted engagement to refine the execution mechanics and add an advanced trade management module. This is not a
I am looking for a skilled developer who can fix an exciting telegram copyingtrades bot for me for 30$ I have the ea source code and python source code everything
SNIPER X AI 30 - 200 USD
I really need a developer Who can help me to create my SNIPER X AI - Elite AI Trading System Overview SNIPER X AI BOT is an AI-assisted trading system for Forex, Crypto, Stocks, Indices, and Gold. Currency: USD,RAND,KWD, POUND,EURO Core Features AI Scalping, Sniper Entries, Auto Buy/Sell, Smart Risk Management, Telegram Alerts, Mobile Monitoring, VPS Deployment. Supported Platforms MetaTrader 4, MetaTrader 5, Exness
Limzy 30+ USD
//+------------------------------------------------------------------+ //| HighPerformanceEA.mq5 | //| Copyright 2026, AI Developer | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026" #property link " https://www.mql5.com " #property version "1.00" #property strict //
I need an experienced MQL5 developer to build a professional XAUUSD scalping Expert Advisor. The trading logic is already fully defined and will be shared privately with selected developers. Requirements Fast execution suitable for scalping Dynamic lot sizing Strict risk management Clean and optimized MQL5 code Compatible with MetaTrader 5 Additional Rules No repainting logic No delayed execution Avoid duplicate
ZigZag based on oscillators is needed The idea of ​​the indicator Create a ZigZag indicator, which is constructed based on extreme values determined using oscillators. It can use any classical normalized oscillator, which has overbought and oversold zones. The algorithm should first be executed with the WPR indicator, then similarly add the possibility to draw a zigzag using the following indicators: CCI Chaikin RSI
Prepare expert for xauusd live chart [ expert is not executing xauusd trades , just printing the logic on the chart ] . Deletion and cleaning code ( subject to if required ) . Integration of candles with present logic, Since expert is coming out from an arbitration subject : Before project start , review the code if it is clean and ready for the developer to continue with previous developer's technical debt -thereby
Hello, I am looking for an experienced developer who can build a professional EA suitable for long-term prop firm account passing and account management. I am NOT interested in risky strategies such as martingale, grid, or aggressive recovery systems. My main priorities are: very low and stable drawdown, strong and consistent risk management, strict news filter, long-term sustainability, realistic and stable monthly
Dear developers. We seek experienced developer in PHP, MySQL, JavaScript. we want to publish custom chart and CSV to our website Homepage. Our MQL5 Script contains custom layout we seek to publish on the website. we are looking for experienced developer in the field of website engineer. we want to broadcast our custom pairs in our website, as outlined in our MQL5 Script. we need React developers
TrendPulse EMA Wick EA 50 - 200 USD
EA specification for MT5 developer (coder‑ready spec) You can copy‑paste this directly into an MQL5 Freelance job. --- 1. General * Platform: MetaTrader 5 (MT5) * Type: Expert Advisor (EA) * Markets: Major FX pairs (configurable list via inputs) * Execution: Market orders only * Timeframes: EA must work on any timeframe, but I will mainly use it on M15–H1 --- 2. Indicators & definitions * EMA 20: Exponential Moving

Projektdetails

Budget
30 - 50 USD
Ausführungsfristen
von 1 bis 14 Tag(e)