Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Quick Position Management Question.

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

    Quick Position Management Question.

    I like to be very aggressive with certain of my risk management methods.

    I'm not a huge fan of buying stock by shares; I would rather put on equally sized positions in dollars and then win/lose a certain % or SD on my trade.

    In a certain way -- in fully discretionary trading -- this is fairly easy to do, although discipline can be a factor.

    When I trade automated, I like to set up a formula for my position sizing and risk management before I begin running my strategies for the day.

    2 questions arise:

    1. I have created a user defined method to convert my position size from shares into dollars. So if I want to trade 30,000 dollar lots in most stocks for the day, I simply calculate:

    $30,000 / Close[0] and then round the number of shares to the nearest hundred. It looks like this in theory:

    double dollarsToShares(int dollars, double stockprice)

    {
    double shareCount = Math.Floor((dollars/stockprice)/100)*100;
    return shareCount;
    }

    I would then use:

    EnterLong(shareCount, basicLongStrategy); or
    EnterShort(shareCount, basicShortStrategy); .


    Unfortunately I am having trouble using the calc in my EnterCommands because it is defined as a double, while I believe the EnterCommands require Int. I am sure that there is an easy fix for this, I just haven't found it yet.

    2. In the interest of becoming more disciplined, I would like to code a line or two that says: "If Position Size = Max Position Size, reject any/all attempts to enter opening orders in that specific security. Basically, I find that my success rate goes way down when I attempt to fight positions by sizing up as they go against me. I recognize that this is also probably easy to code, but would appreciate if someone could point me in the right direction of the documentation I might refer to in order to accomplish this. I am also wondering if it will be easy/hard to override such piece of code, which in general, I do not want to do, ever.

    Thanks in advance for any help and regards to all.


    Last edited by alabell; 08-03-2011, 02:55 AM. Reason: spelling

    #2
    alabell, you can try casting the shareCount to an int :

    EnterLong((int)shareCount, basicLongStrategy);

    This would really need to be coded into your strategy, so basically set the shares used to your maxSize if the sharecount would exceed this #. From the UI we would not offer a position / risk management limitation imposed on all order entry, but this item is already on our list of feedback received for future consideration.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Thanks Bertrand;

      A couple of questions:

      1. Lets say I had a $20.15 dollar stock and i wanted to buy 30k in the name.

      how would I turn my math floor calc into an int variable so that it would buy a correct amount and then round it to the nearest 100 shares ( i assume odd lots are rejected by most brokerages when using ninjatrader, correct?)

      and

      2. You wrote:

      "From the UI we would not offer a position / risk management limitation imposed on all order entry, but this item is already on our list of feedback received for future consideration."

      Please explain.

      Is there no way for me to code my automated strategies to say "if i have 30k in one stock and i try to manually buy more above my self imposed max limit, reject the order" or perhaps just a way to disable all orders that are not a part of my automated strategy platform...so basically I would be saying disable discretionary and semi-automated trading, but allow automated trading to run as coded.

      Thanks for the help.

      Andrew

      Comment


        #4
        Andrew, you would need to custom code your position size rounding here then, or for example use to select the position for the strategy ByAccountSize :



        Unfortunately there's no such option available per default, you could only code a size limitation directly into your strategy, however the strategy instance would only know about it's own orders and executions, not your manual ones.
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by GLFX005, Today, 03:23 AM
        0 responses
        1 view
        0 likes
        Last Post GLFX005
        by GLFX005
         
        Started by XXtrader, Yesterday, 11:30 PM
        2 responses
        11 views
        0 likes
        Last Post XXtrader  
        Started by Waxavi, Today, 02:10 AM
        0 responses
        6 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Started by TradeForge, Today, 02:09 AM
        0 responses
        14 views
        0 likes
        Last Post TradeForge  
        Started by Waxavi, Today, 02:00 AM
        0 responses
        3 views
        0 likes
        Last Post Waxavi
        by Waxavi
         
        Working...
        X