NexusFi: Find Your Edge


Home Menu

 





Risk Management embedded in charts


Discussion in NinjaTrader

Updated
    1. trending_up 3,660 views
    2. thumb_up 4 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 0 attachments




 
Search this Thread

Risk Management embedded in charts

  #1 (permalink)
 Treggs 
Working on my LCD tan
 
Experience: Advanced
Platform: NinjaTrader
Posts: 127 since Jun 2009
Thanks Given: 25
Thanks Received: 52

I'm not sure I have seen this done anywhere so I have made it a coding project for myself. Basically I want to show a number of ticks that should be appropriate as an initial stop loss that has been compensated for current volatility.

I am starting with the 3 * ATR(14) as a volatility stop measure but I want to convert that value to a number of ticks (on any instrument I choose to display) and then compare that number of ticks to a percentage amount of an available trading capital amount. I will be using other methods later but I'll go with 3 * ATR for now while I code it.

For example, if I have an 3 * ATR(14) of 1.5 points on CL, then I want it converted to a tick risk of 15 ticks and a dollar value of n($US150) where n is the number of contracts to be traded. Once I have the dollar value I will compare it to the available trading capital to see if it is under a risk threshold (say 2% of total)

So on my chart I want the following printed.
1. Number of ticks distance from current price for an initial stop loss based on volatility (3*ATR in this case)
2. A dollar value or number of ticks multiplied by contracts traded i.e. $150 or 15 ticks or 3 x 5 ticks
3. A percentage risk of capital available ie $150 risk $10,000 available risk = 1.5%
4. Colour the risk percentage text green or red as a go/no go indication for opening a trade.

The idea of this system is to make proper risk management almost automatic and usable regardless of the instrument I am looking at. Having the figures above on the chart will also make risk/reward and trade sizing much easier on the fly.

I don't want help on the coding project (as I'm trying to challenge myself) but the reason I posted this is to open up a thread on risk management idea's that I might be able to include in this system. Maybe if some good idea's are posted here I can try and include them so it might be useful to others. I won't promise though as I'm a little rusty on my coding and this will be a learning project to help me brush up on my code too.

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Deepmoney LLM
Elite Quantitative GenAI/LLM
ZombieSqueeze
Platforms and Indicators
need some ninjascript help
Traders Hideout
NexusFi Journal Challenge - April 2024
Feedback and Announcements
 

  #3 (permalink)
 
Fat Tails's Avatar
 Fat Tails 
Berlin, Europe
Market Wizard
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,888 since Mar 2010
Thanks Given: 4,242
Thanks Received: 27,102



Treggs View Post
I'm not sure I have seen this done anywhere so I have made it a coding project for myself. Basically I want to show a number of ticks that should be appropriate as an initial stop loss that has been compensated for current volatility.

I am starting with the 3 * ATR(14) as a volatility stop measure but I want to convert that value to a number of ticks (on any instrument I choose to display) and then compare that number of ticks to a percentage amount of an available trading capital amount. I will be using other methods later but I'll go with 3 * ATR for now while I code it.

For example, if I have an 3 * ATR(14) of 1.5 points on CL, then I want it converted to a tick risk of 15 ticks and a dollar value of n($US150) where n is the number of contracts to be traded. Once I have the dollar value I will compare it to the available trading capital to see if it is under a risk threshold (say 2% of total)

So on my chart I want the following printed.
1. Number of ticks distance from current price for an initial stop loss based on volatility (3*ATR in this case)
2. A dollar value or number of ticks multiplied by contracts traded i.e. $150 or 15 ticks or 3 x 5 ticks
3. A percentage risk of capital available ie $150 risk $10,000 available risk = 1.5%
4. Colour the risk percentage text green or red as a go/no go indication for opening a trade.

The idea of this system is to make proper risk management almost automatic and usable regardless of the instrument I am looking at. Having the figures above on the chart will also make risk/reward and trade sizing much easier on the fly.

I don't want help on the coding project (as I'm trying to challenge myself) but the reason I posted this is to open up a thread on risk management idea's that I might be able to include in this system. Maybe if some good idea's are posted here I can try and include them so it might be useful to others. I won't promise though as I'm a little rusty on my coding and this will be a learning project to help me brush up on my code too.


This approach is a bit confusing. as it blends the money management stop and setup. This is the way I look at it:

(1) My setup tells me where the stop-loss should be.

(2) I calculate my position size.

(3) I select the appropriate ATM template that fits the position size.

(4) My money management stop as per template is now larger than the required stop according to the setup.


If I do not want to calculate this for each trade, I can have look at the average true range, define the stop loss as a multiple of the ATR, as you suggested. Then use the risk calculated from stop loss to determine the number of contracts traded. Enter this as a default ATM template ( Default ES, Default 6E, etc.) with the appropriate number of contracts.

When a setup occurs, the stop-loss of the setup should be smaller than the money management stop, otherwise the trade can be skipped. Do not want to have the money manamgent stop on my chart, as it depends on the position size.

Reply With Quote
Thanked by:
  #4 (permalink)
 Treggs 
Working on my LCD tan
 
Experience: Advanced
Platform: NinjaTrader
Posts: 127 since Jun 2009
Thanks Given: 25
Thanks Received: 52

Perhaps I haven't explained it very well as I am basically doing what you have listed but I want the text on my chart so I don't have to calculate my maximum allowable stop for each for each trade. The reason I want to display my money management stop is so I can make sure my setup stop is smaller than my money management stop. The ATR method is just one way of calculating a setup stop position and I also use price action to define where stops go (but that is probably going to be harder to code so lets start with the basics )

I am also thinking of displaying a little more position sizing info i.e. risk amount with different position sizes so I can just pick which one is appropriate and enter the trade. With this sort of info handy, entering a trade correctly can be much quicker so it is possible to catch the really fast moves.

On the chart below i have managed to get the 3*ATR bands working and as you can see from the indicator info I have managed to get the input parameters working fine. I had to learn how to add extra ones above the standard 4 the NT wizard allows. The number below the indicator parameters is the current ATR value. I don't intend to have the bands on my chart I just have them displayed for testing purposes and I can turn them off with BandBool = false.




Started this thread Reply With Quote
  #5 (permalink)
 Treggs 
Working on my LCD tan
 
Experience: Advanced
Platform: NinjaTrader
Posts: 127 since Jun 2009
Thanks Given: 25
Thanks Received: 52

Just had a thought, maybe I should be writing this so the money management stop appears in my market analyzer and setup management appears on the charts. That way I can code different setup stops and it's easily comparable to my money management stops.

Started this thread Reply With Quote





Last Updated on November 9, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts