NexusFi: Find Your Edge


Home Menu

 





Fixed % Risk


Discussion in MultiCharts

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




 
Search this Thread

Fixed % Risk

  #1 (permalink)
no erocla
turin italy
 
Posts: 96 since May 2013
Thanks Given: 43
Thanks Received: 4

Hello guys,

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

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Increase in trading performance by 75%
The Elite Circle
Trade idea based off three indicators.
Traders Hideout
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
ZombieSqueeze
Platforms and Indicators
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Tao te Trade: way of the WLD
24 thanks
My NQ Trading Journal
14 thanks
HumbleTraders next chapter
11 thanks
GFIs1 1 DAX trade per day journal
11 thanks
  #2 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

No Erocla,

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.

Regards,
ABCTG

Follow me on Twitter Reply With Quote
  #3 (permalink)
no erocla
turin italy
 
Posts: 96 since May 2013
Thanks Given: 43
Thanks Received: 4


Thank you for answer, but it changes if you use ATR stop

Maybe i solved it:

 
Code
                            
if ( marketposition and condition1 then BEGIN

Balance 
=  InitialCapital i_ClosedEquity;
STOPLOSS =  (Risk/100)*Balance;
LOT =  (STOPLOSS/(averagetruerange(14)*factor)); // stop amount !

buy LOT contracts next bar at open;

END;

SetStopLoss(STOPLOSS); 

On live trading:
 
Code
                            
Balance GetRTAccountEquity(GetAccountID()); 


It is correct for you ?

Thank you !
No Erocla

Reply With Quote
  #4 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

No Erocla,

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:

 
Code
if ( marketposition = 0 and condition1 ) then BEGIN

Balance =  InitialCapital + NetProfit;
STOPLOSS =  (Risk/100)*Balance;
LOT =  (STOPLOSS/(averagetruerange(14)*factor)); // stop amount !
Print(ElDateToString(Date), "; Time: ", Time:0:0, "; NetProfit: ", NetProfit, "; i_ClosedEquity: ", i_ClosedEquity, "; LOT: ", LOT);
buy LOT contracts next bar at open;

END;

SetStopLoss(STOPLOSS);
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).

Regards,
ABCTG

Follow me on Twitter Reply With Quote
Thanked by:
  #5 (permalink)
no erocla
turin italy
 
Posts: 96 since May 2013
Thanks Given: 43
Thanks Received: 4

Yes i made a control on the code like:

if (LOT<25000) THEN LOT = 25000; (for forex)

same thing to control a maximum amount of margin used.

Regards
No Erocla

Reply With Quote




Last Updated on March 4, 2014


© 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