NexusFi: Find Your Edge


Home Menu

 





Automatic Position Sizing


Discussion in TradeStation

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




 
Search this Thread
  #1 (permalink)
GreenMound
Santon, Isle of Man
 
Posts: 2 since Apr 2016
Thanks Given: 1
Thanks Received: 0

Good morning,

I am looking to automate my position size in TradeStation to maintain a constant X% investment in any given market. Ultimately I will be using this to back test strategies for weighted portfolios, and then active trade.

I found the following as an example:

Equity = Round((Capital + NetProfit + OpenPositionProfit),0);
Num_Cts = Round((PercentAllocationPerTrade * Equity) / {XYZ},0);

where I had intended to use the Initial Margin as XYZ. Is there a way to generically 'call' the initial margin on a futures contract such that the same code can be used on all contracts?

Thank you in advance for any advice you may be able to offer.

GM


Reply With Quote

 
  #2 (permalink)
maryfromcolorado
Denver CO USA
 
Posts: 32 since Sep 2016
Thanks Given: 0
Thanks Received: 13

Trade Station uses LUA to program custom features. You would probably need to do it in that language. It is a scripting language, so fairly easy to learn.

I thought about using it for some of my strategies as I like the TS interface better than metatrader, but its not compiled so it won't be as fast as JForex/Java or Mql Metatrader.

Cheers
Mary


Reply With Quote
  #3 (permalink)
maryfromcolorado
Denver CO USA
 
Posts: 32 since Sep 2016
Thanks Given: 0
Thanks Received: 13


Oh, I forgot that Trade Station also uses Easy Language to program too.

GL
Mary


Reply With Quote




Last Updated on October 31, 2016


© 2026 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 - Downloads - Top
no new posts