Tarea técnica
The purpose is to create a C# app to perform several backtests automatically based on following criteriea.
Backtest App requirements –
a. Backtesting app should be coded in C# and complete source code should be provided.
b. I am using ActiveTick for market data so need the app to connect with ActiveTick to download realtime and historical data.
c. App should be able to work offline (without connecting to ActiveTick) with already downloaded historical data.
d. Historical data should be saved permanently in a SQL database on local computer for last 10+ years of data.
e. Database backup / restore option should be provided in the app to backup or restore database as needed.
f. Historical data should include pre and post market data as well.
g. Backtest records should be available to show in a graph and excel sheet for analysis if position was executed correctly.
h. Backtest equity curve should be displayed on the app
i. Double clicking on any datapoint on equity curve should open that particular symbol chart with buy and sell shown in green and red arrow.
j. Should be able to backtest multiple instruments like Stocks, Indices, Forex etc. for the symbols stored in an excel file. Excel file gets updated often with new symbols.
k. Option to back test few selected stocks or the whole list of stocks from excel file.
l. Update historical data every day for last 10 days (input field).
m. Should be able to download historical data in non trading hours as well.
n. Add back testing “Date Range” (start and end date)
o. Add back testing “Time Range” (start and end time)
p. Should be able to generate report on all symbols that were triggered along with date, time, position size, position open price, position closing price, candle range, candle range high, candle range low, trade count, volume, volume price, profit/loss, slippage and commission.
2. Back Test Criteria (input fields) –
a. Timeframe - All criteria’s below should be over 1 minute candle timeframe with option to change to higher time frame 5 minutes etc. for each criteria separately.
b. All criteria values should be editable.
c. Price range (greater than, less than, between min and max)
d. Percentage change (Open and close price difference of first and last candle of selected timeframe)
e. Inverse – If percentage is > 0 then take Short position and if < 0 then take long position
f. Volume (Shares)
g. Volume (Dollar)
h. Trade count
i. Trade side - Long, Short and Both (Long as base criteria then flip for short)
j. High/Low % – Current price should be above this much percentage from HOD to trigger position. Flip for short.
k. Targets – Multiple profit targets like Target 1, Target 2 and Target 3
l. Stop Loss – Multiple Stop Loss like SL1, SL2 and SL 3
m. Stop loss to be placed at distance equal to the triggered candle range.
n. Trail Stop – Multiple Trail stop Los like Trail1, Trail2 and Trail3
o. Position Size – Option to choose position size based on shares or dollars
p. Variable position size for all Target and Stop orders
q. Indicators – Various indicators selection option like VWAP, MACD, RSI, SMA crossover etc.
r. Single or multiple position option for each symbol
s. Close All time and Close All After hours time.
t. Account level - Daily TP, Daily SL and Daily Trail. All in dollar amount
u. Max Order – Max orders per day for each symbol and max orders per day in total
v. Total dollar amount of all open positions combined should be less than $50k when new position triggered else do not take new position. This $50k should be editable.
w. Flip / Remount / Repeat – Option to flip or remount the order if SL hits. Repeat the order if TP is closing the position.
x. Good after time – When position is triggered it should be filled after this time.
Thanks,
Ravi