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?
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.
The following user says Thank You to RM99 for this post: