DAS Trader Pro Advanced Hotkeys part 34
DAS Trader Pro can stop your overtrading
I have a returning problem with overtrading and the standard risk controls do not provide this functionality, so I had to do some scripts that help me out with it.
For the start, we can see the statistics on how many trades were taken today by double-clicking the account number or by calling this command
showstatistics;
Also, we can read the number of executions from the account object.
GetAccountObj(YOUR_ACCOUNT_NAME).showobject()
The problem with the TotalExe count is that a simple trade with 2 entries for 20 shares and 1 exit can look like this
which counts as 9 executions. For that reason I am using the Alert to count the number of fills which is a more exact counter for trades. If you know a better way, please let me know in the comments.
We need to find the balance in the number of trades. For example, I know myself that if I am over 10 it is a dangerous zone. For you, it can be 5 or 30, depending on your style, but be honest with yourself.
Storing the number of trades filled into a variable
This is easy to be counted with a script. I will just add the relevant parts into my existing Order Fill alert that is doing my automated screenshots and my discord channel posting.
First I use the
savevartofile(trades);
to save the variables in case my DAS crashes and to make cheating one step harder as shutting down DAS Trader Pro and starting it back up will now remember the number of trades.
Then I save the number of trades into the $tradecount variable with
$tradecount=$tradecount+1;
Obviously, this way we need to manage the variable each day as it remembers the count from yesterday.
As my usual trades take 3–4 executions (2 entries+2 exits) I need to count 40 executions for the day.
Monitor the trade count variable
To be informed about the trade count reaching a certain level - 40 in this case we can create a new alert
Which will do just that.
This is a message for you to stop. If it is not enough, we can take it further.
Adding a condition to your entry hotkeys
I wrote about conditional entries
and also
so we can just add a condition to our hotkey that would read the $tradecount variable and not allow the code execution if the value is over the threshold value.
Keep reading with a 7-day free trial
Subscribe to Peter’s Substack to keep reading this post and get 7 days of free access to the full post archives.