MC: IEasyLanguageObject accessible from C# - EasyLanguage Programming | futures io social day trading
futures io futures trading


MC: IEasyLanguageObject accessible from C#
Updated: Views / Replies:1,199 / 7
Created: by PK 1 Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

MC: IEasyLanguageObject accessible from C#

  #1 (permalink)
Silver bullet
Kassel / Germany
 
Futures Experience: None
Platform: MC
Broker/Data: IB
Favorite Futures: ES
 
PK 1's Avatar
 
Posts: 54 since Aug 2011
Thanks: 113 given, 36 received

MC: IEasyLanguageObject accessible from C#

Hello,

since a while I'm trying to build a setup where I can outsource algorithms from MC to C#. I'm not familiar with C++ but did lots of things in C# (except COM-related things), hence my choice for C#. There is a PDF (EasyLanguage_Extension_SDK) and a few threads regarding the interface IEasyLanguageObject (Defined on side of EasyLanguage/Powerlanguage) on the MC-Forum.

What I'm aiming to do is a MC-Indicator calling a C#-Method. The indicator is using {self} to pass a reference to itself and its context (like [n]bars Close, Open, ...). I've created the necessary C++-Interop-DLL in order to communicate with managed code (C#). The reference overgiven from the indicator can be used within my C++-Code. The appropriate interface is IEasyLanguageObject . I can access all necessary data via this interface. Now the problem is forwarding that reference further from my C++-Interop-DLL to C#. Exchanging primitive types via MC <--> C++ <--> C# is no problem at all, works as it should. Both DLLs use PLKit.dll for the type-definitions like IEasyLanguageObject for example.

My approuch: passing the ref from C++ to C# the best way is likely using IntPtr on both sides. Retrieving the interface for the reference from that pointer is the main problem. There are many things regarding the interaction between COM and managed code.

I wonder if anyone here has figured out how to retrieve and access the IEasyLanguageObject -Interface from C#.

 
Code
// 1. Approuch (not complete)
IntPtr ptr = Marshal.GetIUnknownForObject(elRef);              // from IntPtr overgiven from C++ to IUnknown
result = Marshal.QueryInterface(ptr, ref iid, out finalIntPtr); // the iid is the GUID from PLKit.dll

// 2. Approuch (not complete)
ptr = Marshal.GetComInterfaceForObject(elRef, typeof(IEasyLanguageObject));
ptr2 = Marshal.ReadIntPtr(finalIntPtr);
mcRefObj = (IEasyLanguageObject) Convert.ChangeType(ptr, typeof(IEasyLanguageObject));
Is anyone here is using IEasyLanguageObject from C# passed as a reference? I'm not using MC.Net, just the normal MC-Version. Any help appreciated.

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary


In case you haven't seen this thread, maybe it helps: MultiCharts: Trading Software for Automated Trading and Backtesting ? View topic - [Advanced Topic] Programming DLL

Regards,
ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Silver bullet
Kassel / Germany
 
Futures Experience: None
Platform: MC
Broker/Data: IB
Favorite Futures: ES
 
PK 1's Avatar
 
Posts: 54 since Aug 2011
Thanks: 113 given, 36 received

I've checked many threads on MC-Forum as well, that pointed thread I know.

Reply With Quote
 
  #5 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Is there a particular reason why are you not doing this in MC.NET?

Regards,
ABCTG

Reply With Quote
 
  #6 (permalink)
Silver bullet
Kassel / Germany
 
Futures Experience: None
Platform: MC
Broker/Data: IB
Favorite Futures: ES
 
PK 1's Avatar
 
Posts: 54 since Aug 2011
Thanks: 113 given, 36 received


PK 1 View Post
I'm not using MC.Net, just the normal MC-Version.

My license is for MC not MC.Net

Reply With Quote
 
  #7 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

I don't know how much time you have already spend with this project, but you'll probably spend some more with it. That's why I thought it might make sense to go with the .NET version, even more so as you are versatile with C#.

You can probably get a discount for MC.NET as you have already a license for the regular version. Just my two cents, in the end I don't know how much code you have to convert etc. and you have probably done the math about switching already.

Regards,
ABCTG

Reply With Quote
 
  #8 (permalink)
Silver bullet
Kassel / Germany
 
Futures Experience: None
Platform: MC
Broker/Data: IB
Favorite Futures: ES
 
PK 1's Avatar
 
Posts: 54 since Aug 2011
Thanks: 113 given, 36 received


ABCTG View Post
Just my two cents, in the end I don't know how much code you have to convert etc. and you have probably done the math about switching already.

Actually off-topic ... In fact, you are right and I did a proof of concept with calling my dll from MC.Net. Easy going! They charge 199$ for converting the license, which is imho ok. But there are things that kept me from really migrating to the .Net-Side.
  • Indicator on Indicator was proposed for version 9 (MC-Statement from spring 2013) but not anymore after I asked them about it
  • programming this for my own in my indicators and doing this for builtin-indicators via a wrapper would be ok for me but I can't see a way to do this. The suggested examples for this given on MC-Forum are not related to what I need to do. I have an example on the support forum ... maybe this can be done easily and I've just overseen something.
  • One big minus is the two missing default settings - checkbox in the Format-Study-Dialog for Input and Style. Applying a default is not possible ... implementing the checkboxes for MC.Net is not possible according to the support. This might sound like a minor problem but can get a real nightmare.
  • Another point I came upon is the PLE being in charge of the .Net-Projects for C# and VB. This of course was meant to be that way in order to realize the integration of extern editors, so far no problem. But one has to be aware that from time to time PLE is doing something in the background causing the project to change. Actually no problem either. But in case there is getting something wrong the user can do nothing. One example: for me I've converted half a dozens of bigger indicators on the C#-Side, never did anything on the VB-Side. But from nothing after starting VS from PLE the VB-Project was missing the reference to PLStudiesProxy.dll, hence almost 200errors ... of course they don't count because compilation is done by the PLE but Intellisense and normal development hardly possible. As PLE triggering the generation/change of the two projects I couldn't change this wrong project. Strange but true on PLE-Side the project was fine. The support asked me to send the code in order to investigate but thats hardly possible here. So in the end there's a lot happening under the hood when dealing with .Net-Version which the developer is not in charge of.
  • It's told the functionality of MC and MC.Net is the same but thats obviously not true for some specific things. I've checked the .Net-Forum and it looks like there are some other points ... maybe no big deal either but surprise when one is recognizing this.
--> so for me it would take long time to migrate due to the huge amount of code and some things got me thinking hardly whether it's really worth migrating. I've put much time into evaluating but at the moment for me it's better to stick with my MC-Configuration.

AddOn: Regarding my second point this could be possible with Lambda-Expressions I've read on MC-Forum. There's a class defined for Multicharts: Powerlanguage.Lambda<T> : ISeries<T>

m_rsi.price = new Lambda<double>(_barsBack0 => (Bars.Close[_barsBack0] * 2));


Last edited by PK 1; March 20th, 2014 at 07:58 PM.
Reply With Quote
The following user says Thank You to PK 1 for this post:

Reply



futures io > > > > > MC: IEasyLanguageObject accessible from C#

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
MC Traders dynamic index -> conveting to MC yiman MultiCharts 12 August 2nd, 2016 11:40 AM
MC! Need a button cwjj MultiCharts 1 March 11th, 2012 02:24 PM
Can I do the following on MC? 30percent EasyLanguage Programming 3 January 29th, 2012 08:40 PM
VSA in MC? TonyB MultiCharts 10 May 28th, 2011 11:37 AM
MC indicators cory MultiCharts 1 May 21st, 2011 06:09 AM


All times are GMT -4. The time now is 05:49 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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.
no new posts
Page generated 2017-12-17 in 0.12 seconds with 19 queries on phoenix via your IP 54.163.210.170