In Strategy Monitor, not all trades are executed due to insufficient capital
Author: sedelstein
Creation Date: 5/19/2016 6:30 PM
profile picture

sedelstein

#1
I am trying to paper trade my intra-day rotation strategy.

I have configured my PaperAccount1. It has a balance of 1mm (1,000,000) dollars

I am activating the strategy in Portfolio Simulation mode with a Margin Factor of 10 to 1 and a fixed dollar size per trade of 200,000. This is realistic as Fidelity will give me quite a lot of leeway for intraday buying power.

I've put the strategy in the strategy monitor and it executes and autotrades without a hitch but It will only execute 5 trades of 200k each before it tells me I have insufficient capital to trade the other 15 trades I'd like to execute. The total of longs and shorts is 4mm absolute dollar value, well within the 10:1 margin limit of 1mm*10 = 10mm.

Is there something else that I am not setting? I'm unsure as to why the insufficient capital error appears.

Thanks for your help
profile picture

Eugene

#2
QUOTE:
I am activating the strategy in Portfolio Simulation mode

You shouldn't. Use Raw Profit instead. See the User Guide > Strategy Monitor > Characteristics of the Strategy Monitor > Operational difference between the Strategy Monitor and Backtester for an important note.
profile picture

sedelstein

#3
Got it. So what I think this is saying I think is that use of leverage in the strategy monitor is unavailable. (Running in RP mode led to the same errors which is why I tried port sim mode because it had a leverage factor available whereas RP did not). In actual live trading in a real account, should I expect this not to be a problem provided there is sufficient buying power?

In the strategy itself, the position size is 10k (way smaller). I set it to 200k in the SM
profile picture

sedelstein

#4
Just tried this again with paper accounts configured to 10mm. Same error. Do I have to exit the SM and or WL and restart?
Exited WL and relogged in to Fidelity - Paper accts have 10mm.

Will have to try again tomorrow but if you have suggestions please let me know
profile picture

Cone

#5
It looks ok to me, so it seems we're missing some information from you on how to duplicate what you're seeing.

Note: if you modify your code, you need to restart the S. Monitor to use the modification there.

Here's a strategy that I just used to test that margin works properly. I ran it on 1 symbol, adjusting the parameter as required for the number of trades desired.

CODE:
Please log in to see this code.
profile picture

Eugene

#6
Steve, could it be that you're changing Margin Factor in the DataSets tree rather than in the strategy's Properties in the SM?
profile picture

sedelstein

#7
Here is what I am doing in the strategy monitor
profile picture

sedelstein

#8
QUOTE:
Steve, could it be that you're changing Margin Factor in the DataSets tree rather than in the strategy's Properties in the SM?


Here is another snapshot. I'm not sure what you mean. I only see 1 place to change the margin factor
profile picture

Eugene

#9
The placement is correct, the idea is not. I don't think that Margin Factor applies to Raw Profit trades. In RP mode all your trades should have been taken. Sorry for the confusion.
profile picture

Cone

#10
Right. Margin Factor is for Portfolio Simulation Mode sizing only.

It looks to me as if there are 0 trades. For Raw Profit mode, that's probably a problem with the script (or the strategy just doesn't generate trades for that 500 bar test period).

Anyway, please look at my post in the other thread for running your strategy. I think it will be a breakthrough for you.
profile picture

sedelstein

#11
Ok. Thanks for the suggestions. It does seem odd though that when I run outside of the strategy monitor it does generate trades.
profile picture

Cone

#12
Is it possible because you didn't set your "Hour / Minute of day" parameters for the time of the Next Run?

The image shows the Strategy running at 10:35 PM, but the Minute parameter is "5" (or starts with a "5"). Anyway, the last bar of the day is probably marked 1600.
profile picture

sedelstein

#13
Well, for 3 accounts where I configured the account value to be 10mm, the 20, 200k trades filled and worked today (e.g. sufficient capital)
For the 1 account configured for 500k, (PaperAccount4) 2 trades filled (worth 400k) and the others did not.

I imagine it will work for my actual trading account as I will have sufficient buying power so for paper trading and strategy testing I will just make the account arbitrarily large.

This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).