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 Rapine Heihei, Today, 08:19 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 08:25 PM
    0 responses
    3 views
    0 likes
    Last Post Rapine Heihei  
    Started by f.saeidi, Today, 08:01 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Manfred  
    Started by Rapine Heihei, Today, 07:51 PM
    0 responses
    6 views
    0 likes
    Last Post Rapine Heihei  
    Started by frslvr, 04-11-2024, 07:26 AM
    5 responses
    96 views
    1 like
    Last Post caryc123  
    Working...
    X