Help Center Blog Open An Account

Form objects programming in MC.net version


#1

Greetings! I have to say I’m newbie on MC and still getting initiated on that platform, so please, be patient with me. I have a question regarding form objects using C#. I have my code written in other trading platform and because I got tired of it I just decided to change to an open data source trading platform like MC. My problem is that my panel doesn’t generate in MC, although I checked with VS2010 and seems to be all working perfectly, the panel never opens. May you help me please?


#2

Hi my friend. Actually that question is sooo big that without viewing the code I don’t know what may cause the loading fail. The good thing is that you don’t get an error when loading this script, so the logic must be working, at least to a certain point.
First, I recommend you to put your initiation after the if(Bars.LastBarOnChart) which checks you are in the most recent bar into the chart, so data from Closes - Opens - Highs - Lows doesn’t get confused when playing with them.
Second is, and it is only a guess, you said you are working with panel object, I suspect it is to include all the form objects within. You have to options, work with TPO .net study version, I believe you will find interesting info inside that will help you understand better how MC works with form objects. The second option is to use a “Form” instead of a “Panel”
public System.Windows.Forms.Form panel=null;
Just change Form where it says Panel and it should work. I tell you that because I faced the same issue, that’s why I’m telling you to use Form instead of Panel. You decide
Third, do some debug. Use Output.WriteLine(COnvert.ToString() + " ") to show which is the last reading inside every if or else conditional


#3

Good evening softdevMC. Thanks for being that fast. I’ll check what u suggest. The fact is that I’d never thought of using Form instead of Panel…I do control the Bars.LastBarOnChart event, so I’m going to try this and let you know about it. Also thanks for suggesting using Output.WriteLine…I had tried so many times to prompt data to the output window but seems i need to invest more time in learning MC coding. Thanks a lot


#4

Hi JoseMarti. Good evening to you.It was a big pleasure to help you. Please let me know how it goes.