Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm trying to implement some Money Mgmt and Compounding into my EasyLanguage strategy. Not really sure where to start though and just need someone to point me in the general direction.
It would be good to be able to have an input called riskPercent which is calculated on your capital which in turn determines the position size based on riskPercent / stopLossPips.
Check out the help index on development environment.
For what you're looking for, you should check out the "AccountFields" class...
such as Value[RTAccountEquity] or whatever equity parameters you would like to base your position size upon.
Secondly, you should check out the "setxxxxx" suit of functions.
Some of the setstops are based upon a position value, some are based upon a per contract value.
Between setstoploss, setprofittarget, setdollartrailing, setstopcontract, setstopposition, setbreakeven, etc, you should be able to craft your desired exit criteria.
I currently don't use any of the setxxxx suit of functions and just create my own functions such as:
if marketposition = 1 and close >= (EntryPrice + ProfitPoints) then sell next bar at market;
I do this so I have more control to do things such as sell half a position and let the rest ride. Also the setxxxx suit of functions cannot be in a condition. I'm also lead to believe (although this could be wrong) that the setxxxx suit of functions gets posted straight to the broker?
I can't seem to find the value function you speak of except for the built in variable value1, value2 etc....
For Money Mgmt I'm trying to accomplish something like this:
This seems to work but I have no way of getting the Account Balance and am just setting this as an input. It would be nice if I could have this read from the broker? or set it once and have it increase/decrease as the account balances goes up/down (overall up of course ) Maybe something like if a trade is successful increase AccBalance by the profit?
The "getxxxxxx" functions will supply you with whatever numerics you're looking for. You can either manually specify your account number or use the "GetAccountID" function to return it.
Sweeet just what I'm looking for RM99. Much appreciated.
RM99 do you think I should look more into using the setxxxx suite of functions? Do you know if these orders are held locally and then sent when triggered or are they sent immediately to the broker?
Well, I can't speak for MC, but assuming they use similar/same exchange parameters and syntax/coding with EL, the short answer is....not in the way you're hoping.
TS exchange server updates the automated orders every 15 seconds. Additionally, if there are 2 different orders (as in a simple bracket with a profit target and stop loss) then the strategy "toggles" between the two picking whichever is "closest" to the current market price.
I know what you're seeking....and the holy grail of "unattended" or hands free trading is not possible on TS (and I'm assuming it's not with MC either).
The only solution I've seen is using macros to execute OCO (order cancels orders) or OSO (order supplemental order) orders just like you would using the platform manually. Even then, i'm not sure if TS maintains those orders on the exchange server in the event you have a disconnection. Essentially, the exchange server is an intermediate between you (and your platform) and the exchange itself......just like the challenges of manually moving a stop on the trading matrix (when you drag and drop, if the market is moving quickly, it can pass your mouse by) the automated strategy orders are not maintained beyond your computer reminding the intermediary to keep them until the price reaches the order and then (and only then) is it sent to the actual exchange.
In the end, not only is it not currently available, but I don't think the engineers really care to develop "hands free" or unattended trading capability....even from a philosophical perspective. Their whole take is that automated trading should be a "cruise control" or "autopilot" and not a "fire and forget" system.
I will tell you that there are things that will complicate your auto exits...
1) Using IOG (if you can ABSOLUTELY help it, don't use IOG, as it asks your system and the exchange server to update ever tick, which can be several times/second on highly volitile instruments....and again, if you're toggling or using multiple orders simultaneously, it MAY create snags with live execution).
2) TS recommends using "synthetic market if touched" orders...which will reduce the number of signals produced or maintained and only issue an order once the price reaches a certain point (which you incorporate into your coding).
In the end, like I said, I'm not sure that even using manual macro orders maintains orders at the actual exchange. I know with my old broker and using TransAct, my orders bracket orders would actually get issued to the exchange and then i would get a cancellation order if I moved it (with a number). However, with TS's trade matrix, there's so much functionality that I think using trailing stops and OCO's and such, if the platform isn't live and functioning to send the follow on signals, you end up flying blind with an open position.
Lastly, the only REAL solution to the problem you're trying to solve (unattended trading) is to hire a just graduated finance student at $15/hour to baby sit your system Or baby sit it yourself.