NexusFi: Find Your Edge


Home Menu

 





EasyLanguage Collective2 Interface (MultiCharts to Collective 2)


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one Big Mike with 18 posts (12 thanks)
    2. looks_two gpw797 with 5 posts (0 thanks)
    3. looks_3 bomberone1 with 4 posts (0 thanks)
    4. looks_4 NicoVersailles with 3 posts (0 thanks)
    1. trending_up 26,729 views
    2. thumb_up 14 thanks given
    3. group 13 followers
    1. forum 41 posts
    2. attach_file 0 attachments




 
Search this Thread

EasyLanguage Collective2 Interface (MultiCharts to Collective 2)

  #21 (permalink)
 arjfca 
Montreal, Canada
 
Experience: Intermediate
Platform: Multicharts
Broker: Interactive Broker
Trading: Forex
Posts: 263 since Sep 2010
Thanks Given: 440
Thanks Received: 91


Big Mike View Post
Take it one step at a time and tell me specifically/exactly what step you do not understand or where you have a problem.

BTW, this entire solution requires some computer knowledge, so if you are not a PC guru then this method is not for you.

Mike

Hello Sam

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

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
NexusFi Journal Challenge - May 2024
Feedback and Announcements
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
48 thanks
Just another trading journal: PA, Wyckoff & Trends
35 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
  #22 (permalink)
NicoVersailles
Versailles
 
Posts: 8 since Mar 2010
Thanks Given: 0
Thanks Received: 0

Hello everybody!

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...

any idea?

Thank u all.

Reply With Quote
  #23 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610



NicoVersailles View Post
Hello everybody!

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...

any idea?

Thank u all.

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.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #24 (permalink)
 bomberone1 
London
 
Experience: Beginner
Platform: MultiCharts
Posts: 277 since Nov 2010
Thanks Given: 14
Thanks Received: 29

Do you ask at team of collective2 or mujlticharts in project managment to implement thisd feautures?

I think that is better interface certificated by multicharts than own code.

Reply With Quote
  #25 (permalink)
Simon Li
China
 
Posts: 1 since Jun 2011
Thanks Given: 1
Thanks Received: 0

Hi Big Mike,
Learn from Stan of MC that you've developed the interface, can you send me a copy ?
Currently I have a test system in Collective 2.

Thanks !

Reply With Quote
  #26 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610


Simon Li View Post
Hi Big Mike,
Learn from Stan of MC that you've developed the interface, can you send me a copy ?
Currently I have a test system in Collective 2.

Thanks !

Everything is posted in this thread.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #27 (permalink)
 gpw797 
Mesa, AZ
 
Posts: 55 since Oct 2010

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?

Reply With Quote
  #28 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,446 since Jun 2009
Thanks Given: 33,217
Thanks Received: 101,610

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.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #29 (permalink)
 gpw797 
Mesa, AZ
 
Posts: 55 since Oct 2010

replying with code to see code correctly w/o winks.

// Big Mike Trading https://nexusfi.com/
// Apr 5 2010

{ C2 Signal Entry API }

{
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

}

{
The URL is in the following format:

https://www.collective2. com/cgi-perl/signal. mpl?[PARAMETERS]
}

inputs:
cmd ( StringSimple , { signal, closeallpositi ons }
systemid ( NumericSimple , { c2 system id }
pw ( StringSimple , { c2 password for said id }
action ( StringSimple , { BTO, SSHORT, STO, B TC, STC }
quant ( NumericSimple , { order quantity }
instrument ( StringSimple , { stock, option, future, forex }
c2symbol ( StringSimple , { symbol for instru ment }
c2limit ( NumericSimple , { optional }
c2stop ( NumericSimple , { optional buy s top/sell stop }
c2target ( NumericSimple , { target price, 0 for none, use with stoploss for OCO }
c2stoploss ( NumericSimple , { stop loss pric e, 0 for none, use with target for OCO }
duration ( StringSimple ; { DAY, GTC }

vars:
result ( 0 ,
filename ( "C:\Users\Mike\Documents\MultiCharts\Collective2\si gnal.txt" ,
c2baseurl ( "http://www.collective2.com/cgi-perl/signal.mpl?" ,
c2query ( "null" ;


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));

Reply With Quote
  #30 (permalink)
 gpw797 
Mesa, AZ
 
Posts: 55 since Oct 2010


Having trouble getting my strategy to compile with the code


If marketposition = 0 then begin

If dma > dma[1] and condition99 then begin//buy contractsize contracts next bar at market;
Value1 = collective2("signal", c2id, c2pw, "BTO", 1, "future", "QCLQ1", 0, 0, (Close + (100 * MinMove/PriceScale)), (Close - (100 * MinMove/PriceScale)), "DAY");
end;

If dma < dma[1] and condition99 then begin //sellshort contractsize contracts next bar at market;
Value1 = collective2("signal", c2id, c2pw, "STO", 1, "future", "QCLQ1", 0, 0, (Close + (100 * MinMove/PriceScale)), (Close - (100 * MinMove/PriceScale)), "DAY");
end;

end;

getting error message

------ Compiled with error(s): ------
Types are not compatible
errLine 120, errColumn 0, errLineEnd 120, errColumnEnd 0
causal study: (Function)

line 120 is the value1... line

any idea what I am doing wrong here?

Reply With Quote




Last Updated on June 8, 2014


© 2024 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 - Privacy Policy - Downloads - Top
no new posts