Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

call excessMargin

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

    call excessMargin

    Well this is my plan.

    Run three concurrent strategies. Trading corn, soybeans, and wheat futures. Due to margin differences I would like a way to calculate against my excess margin. Were I to calculate against my account only one of the three strategies would try to take all the money for it's own purposes. And then the other two would error out due to "not enough funds to trade".

    If it was based off of excessMargin though then corn would take the maxContractsCorn, say 5. Leave xxxxx funds left over. Then soybeans would take up to maxContractsSoybeans, say 3 or so. Then wheat would take as much margin as it could up to it's max. Leaving a buffer to ride out short term stop-losses. Also allowing the script to automatically start using more funds as they become available.

    Edit: I guess also, is there a way to tell the script how much margin is per given contract. That way it can do

    marginExcess/soybeansMargin = soybeansTraded;
    soybeansTraded =< maxsoybeansTraded;
    maxsoybeansTraded = 3;

    Is this possible in NT scripting?


    Thanks,
    Rhy.
    Last edited by Rhyshaelkan; 08-07-2009, 08:02 PM.

    #2
    Rhy, thanks for the post - yes you can set the used margin per product in the Instrument Manager, but unfortunately you would still need to access your live account info to allocate free margin as you lined out. This is not possible with NinjaTrader 6.5, but it will be in NinjaTrader 7 (level of detail depending on which brokerage technology you use) -

    BertrandNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Kaledus, Today, 01:29 PM
    5 responses
    12 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by Waxavi, Today, 02:00 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by alifarahani, Today, 09:40 AM
    5 responses
    23 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    3 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by PhillT, Today, 02:16 PM
    2 responses
    7 views
    0 likes
    Last Post PhillT
    by PhillT
     
    Working...
    X