Hello,
when i have defparam on true, how can i during a backtest set a maxium contracts that can be open?
In the real money mode you can set the maxium contracts at the beginning, but that is not possible in the backtest mode.
thanks for support
You can try something like this:
MaximumContracts = 50
TooManyContracts = abs(countofposition) >= MaximumContracts
If not TooManyContracts and (your conditions) then
Buy 1 contract at market
endif
Not tested.
You can use:
So you can test, say, that you don’t have more than 3 contracts open:
IF MyConditions AND COUNTOFLONGSHARES < 3 THEN //accumulate contracts up to 3
BUY 1 CONTRACT AT MAERKET
ENDIF
You were so fast Vonasi, I was still typing while you were posting!
I am too late
You snooze you lose! I even had time to edit the title to get rid of the ‘shouty’ capitals and misspelling before you got here – you are being slowed down due to eating too many Easter eggs I think!
hahahaha … good job you 3 fast guns are here! 🙂
hahahaha … good job you 3 fast guns are here! 
As Sheriff of the Code Snippets Library I thought you was gonna say that you corralled it into there!
Yep … all rounded up and locked away in here
Snippet Link Library 🙂