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 will put this project on the side for some time.
I realise that, even if my strategy is interesting and return very nice profit for the last 12 months, I still have work to do on it. I got extended periods with gain floating around a profit level. This could be discouraging if someone entered in the strategy at this period.
Also, the project for an external server will have to be process first.
Martin
Can you help answer these questions from other members on NexusFi?
I've got problem to implement the "xreplace" C2 function, which replaces the SL for example; but to do that, we need a "signal stop ID" which is given by a response-xml to our first order (signal). So my autostrat can't know it...
My SL often changes so I'm a bit lost with this.
MC says that they will implement C2 in their code but no deadline...
You would need something more elaborate than what I provided to read the response file. wget is storing the response file, so it's just a matter of reading/parsing the data. I'm not sure if there is an EasyLanguage function to read from a text file or not, but if so, shouldn't be too hard from there.
Another approach would be to handle that part via dos command line instead of easylanguage entirely, just keeping the signal ID outside of easylanguage and knowing that when you do a xreplace, you need to provide it. Just need some basic dos scripting or windows powershell.
starting to play with this and have a couple questions. Mainly don't understand the first part or function code part..
1) The function code.. is this C or easylanguage? What does file get saved as including extension? Not sure how MC accesses this
2) The code shows up here with "winks" and cut and pasting the code is creating problems I think.. also there are spaces where there shouldn't be spaces I think. Can you please post as an attachment?
1. All EasyLanguage. For the function, you go to PowerLanguage editor and do New - Function. For strategy signal, you do new - signal.
2. The winks is a bug, and I am waiting for a fix. For now, you can replace winks with ), or if you reply to my post w/the code, you should be able to see the code as was intended w/o the smiley markup. I can't attach as a PLA because I no longer have this version of the code on my system.
{
Parameter Value or Example What it Means Comments
cmd= signal
systemid= 123456 The system ID displayed as above.
pw= loginPassword case sensitive
action= BTO Buy To Open open a long position
SSHORT Sell Short used for stocks
STO Sell To Open used for non-stocks
BTC Buy To Close close a short positio n
STC Sell To Close close a long positio n
quant= 100 Number of shares or contracts
instrument= stock Note that ETFs like QQQ and DIA are traded on a stock exchange and thus are considered stocks.
option
future
forex
symbol= IBM You are responsible for looking up your own symbols. If you trade Forex, you know that Collective2 figures out Forex symbol s automatically when you manually enter trades on the Web site. However, you'll need to enter already-valid symbols when using the Web service interface .
limit= 35.06 Only use if this is a l imit order.
stop= 20.10 Only use if this is a st op order. For market orders, do not use either sto p or limit parameters.
duration= DAY Day Order
GTC Good Til Cancel
if cmd = "signal" then begin
c2query = text(c2baseurl, "cmd=", cmd, "&systemid=", systemid:0:0, "&pw=", pw, "&action=", action, "&quant=", quant:0:0, "&instrument=", instrument, "&symbol=", c2symbol, "&duration=", duration);
if c2limit > 0 then c2query = c2query + "&limit=" + text(c2limit:0:2);
if c2stop > 0 then c2query = c2query + "&stop=" + text(c2stop:0:2);
if c2target > 0 then c2query = c2query + "&profittarget=" + text(c2target:0:2);
if c2stoploss > 0 then c2query = c2query + "&stoploss=" + text(c2stoploss:0:2);
end;
if cmd = "closeallpositions" then begin
c2query = text(c2baseurl, "cmd=", cmd, "&systemid=", systemid:0:0, "&pw=", pw);
end;
if GetAppInfo(aiRealTimeCalc) = 1 then FileAppend( filename,c2query + newline);
Text_New(date, time, C, text("c2: ", cmd, action, quant:0:0));
if c2target > 0 then Text_New(date, time, c2target , text("c2: target ", c2target:0:2));
if c2stoploss > 0 then Text_New(date, time, c2stop loss, text("c2: stop ", c2stoploss:0:2));