Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

How can I optimize 2 outputs by varying 3 variables and maintaining the others fixed?

1 Ansicht (letzte 30 Tage)
Hello, I'm very new to MATLAB and I'm not finding something that could help me solving this problem. So, here goes the problem:
a) I have this function: function [Cum_PnL, SharpeRatio, Kelly, Win, Max_profit, Max_drawdown, num_of_trades, Positive_trades] = ...
bollinger_backtest_gcrodrigues(pair, lookback, nstDev, minDist, lasTrade, type, cost)
where pair is a cell matrix that I get from another cell matrix, i.e, pair=pairs_short(1,:)
lookback, nstDev, minDist and cost are double, lasTrade and type are strings.
b) my initial input parameters are pair = pairs(1,:), lookback = 10, nstDev = 1.8, minDist = 0.3, lasTrade = '16:00', type = 'e' and cost = 0.036.
I obtain these outputs: SharpeRatio =0.2330 and Positive_trades = 3.
c) what I need is to maximize SharpeRatio for Positive_trades >=7, varying lookback: 6 < lookback < 144 (increasing by 1, i.e., 6,7,8,9,..144), nstDev: 1.8 < nstDev < 4 (increasing by 0.01, i.e, 1.81, 1.82,...,3.98,3.99,4), minDist: 0.3 < minDist < 4 (increasing by 0.01). Remembering pair, lasTrade, type and cost are fixed.
Then, How can I do this optimization?
Thanks in advance.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by