Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
sheriff4000 committed Jun 9, 2024
1 parent 9509457 commit d7731f2
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/Backtest/strategies/FALM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ using Suppressor
using DotMaps
using Statistics

using JuMP:@variable, @expression, Model, @objective, @constraint, optimize!, @NLobjective, value, set_silent
using JuMP:
@variable,
@expression,
Model,
@objective,
@constraint,
optimize!,
@NLobjective,
value,
set_silent
using SparseArrays: sparse, I, spdiagm
using Ipopt: Ipopt
import MathOptInterface as MOI
Expand Down Expand Up @@ -102,7 +111,7 @@ function my_ordersForPortfolioRedistribution(
account::Any=nothing,
costPropFactor::Real=0,
costPerTransactionFactor::Real=0,
min_shares_threshold::Real=10^-5
min_shares_threshold::Real=10^-5,
)
# Generate Source Distribution from Portfolio
totalValue = sum([sourcePortfolio[x] * assetPricing[x] for x in keys(sourcePortfolio)])
Expand Down Expand Up @@ -153,7 +162,10 @@ function my_ordersForPortfolioRedistribution(
####
#### Parsing & Order Generation
####
n_shares = Dict([assetSort[x] => d[x] for x in 1:N if (x != curency_pos) && (abs(d[x])>min_shares_threshold)])
n_shares = Dict([

Check warning on line 165 in src/Backtest/strategies/FALM.jl

View check run for this annotation

Codecov / codecov/patch

src/Backtest/strategies/FALM.jl#L165

Added line #L165 was not covered by tests
assetSort[x] => d[x] for
x in 1:N if (x != curency_pos) && (abs(d[x]) > min_shares_threshold)
])
orders = [my_genOrder(x, n_shares[x]; account=account) for x in keys(n_shares)]
return orders

Check warning on line 170 in src/Backtest/strategies/FALM.jl

View check run for this annotation

Codecov / codecov/patch

src/Backtest/strategies/FALM.jl#L169-L170

Added lines #L169 - L170 were not covered by tests
end
Expand Down

0 comments on commit d7731f2

Please sign in to comment.