Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order quantity based on risk

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Order quantity based on risk

    Not really a technical question, just hoping someone can help me figure out the math here, it's got me utterly confused...

    What I'm trying to do is have my strategy define order size (forex) based on a risk in USD. Let's say the ammount I'm willing to risk on any trade is USD$100.

    Risk would be the stoploss amount; let's say I'm using ATR*2.

    -What would be the formula for currency pairs involving USD (EURUSD/USDJPY...)?

    -What would be the formula for pairs not involving USD (Say EURJPY)? I assume I will need to use the EUR/USD exchange rate, or the USD/JPY exchange rate, or both?

    Any help would be appreciated!

    #2
    Hello Marktheshark,

    Thank you for your note.

    If your risk is your Entry minus your stop, times your trade size,

    Code:
    (Entry-Stop)*TradeSize=Risk
    Then, if my math is correct,

    Code:
    TradeSize = Risk / (Entry-Stop)
    An example,

    You buy EUR/USD at 1.1700, the ATR is at 1.1600 and you wish to risk $100.

    Code:
    TradeSize = $100 / (1.1700-1.1600)
    You would then trade a size of 10,000.

    I highly suggest doing your own research into whether this is correct.

    Regarding the EUR/JPY ratio, I would suggest searching the net for Cross Currency trades along with how to calculate the stop point.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your help - I figured it out.

      I realise this is basic stuff but in case anyone is interested, this is what I did:

      double PipValueUSD = (1/ExchangeRate);
      double StopLossValueUSD = 2*ATR1[1]*PipValueUSD;
      double OrderSize_double = 100/StopLossValueUSD;
      int OrderSize = (int)OrderSize_double;
      ExchangeRate is a configurable parameter in my strategy. The value should be the exchange rate of the USD to the second currency in the pair. For trading EURAUD, use the USDAUD value (1.4). For EURJPY use 111. For pairs with USD as second currency, enter 1.

      The "100" is the risk in USD I'm willing to take on the trade.

      Comment


        #4
        Do we have the script for Futures or Equity, please?
        And should we put this script?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        50 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        127 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        69 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        42 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        46 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X