Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
anyone know if there's any method to set a fixed percent of risk* trades ?
For example, i would like that my TS risks always the 1% of Balance per Stoploss (calculated on ATR).
I found it not so easy to do, because SetStopLoss is a cash value and give to me some problem.
Thank you for any answer !
Best Regards
No Erocla
Can you help answer these questions from other members on NexusFi?
what is the code you have so far that is giving your problems?
Two ideas on how you can go over it:
- Use 1% of the broker account balance as the dollar value for stop loss. This will only make sense when you are trading realtime and are connected to a brokerage account.
- For backtesting or forward testing where you are not connected to the brokerage account set a starting balance via an input in your strategy and add the NetProfit. This will give you the changing balance. Use 1% of this value for the dollar stop amount.
at a glance it looks okay. From the code you compute the dollars to risk and use this to size the position. Although the reserved words starting with "i_" are meant to be used in indicators to receive information from signals, but you can probably use them in signals without problems. To make sure you can change the code to this and test it:
On a separate matter your lot size will probably come out as a fractional value, so you might want to consider rounding it down to the lowest full lot size (use Floor for this).