Maximum Contracts
Forums › ProRealTime English forum › ProOrder support › Maximum Contracts
- This topic has 9 replies, 5 voices, and was last updated 5 years ago by GraHal.
-
-
04/20/2019 at 2:00 PM #96841
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
04/20/2019 at 2:48 PM #9684204/20/2019 at 3:06 PM #96843You can use:
- COUNTOFPOSITION https://www.prorealcode.com/documentation/countofposition/
- COUNTOFLONGSHARES https://www.prorealcode.com/documentation/countoflongshares/
- COUNTOFSHORTSHARES https://www.prorealcode.com/documentation/countofshortshares/
So you can test, say, that you don’t have more than 3 contracts open:
123IF MyConditions AND COUNTOFLONGSHARES < 3 THEN //accumulate contracts up to 3BUY 1 CONTRACT AT MAERKETENDIF04/20/2019 at 3:07 PM #96844You were so fast Vonasi, I was still typing while you were posting!
04/20/2019 at 3:34 PM #9684504/20/2019 at 4:30 PM #9684604/20/2019 at 4:56 PM #96847I 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!
04/20/2019 at 9:07 PM #9685404/20/2019 at 9:59 PM #96855hahahaha … 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!
04/21/2019 at 9:20 AM #96858Yep … all rounded up and locked away in here
-
AuthorPosts
Find exclusive trading pro-tools on