Print error

Questions about MultiCharts .NET and user contributed studies.
ManuelVene
Posts: 17
Joined: 12 Jun 2015
Been thanked: 1 time

Print error

Postby ManuelVene » 12 Jun 2015

Hello,
I'm getting an error trying to output in a file.
I really can't understand what's going on, the code is just so simple that I don't understand where the problem could be.
I'm new to C#, and probably that is the real problem.
By the way all I'm trying to do is printing in a Txt fie date and time when an order is sent:

Code: Select all

if(Bla Bla Bla){
m_ChBrkLE.Send(m_HighestFC[0] + (Bars.Point*10*Pips));
Print(File("C:\test.txt"), CurrentDate, CurrentTime);
}
but this error is returend:
The name 'Print' does not exist in current context. "Channel_Breakout_E" [Strategy] Ln 80
The name 'File' does not exist in current context. "Channel_Breakout_E" [Strategy] Ln 80
The name 'CurrentDate' does not exist in current context. "Channel_Breakout_E" [Strategy] Ln 80
The name 'CurrentTime' does not exist in current context. "Channel_Breakout_E" [Strategy] Ln 80

That is a translation of the actual error that is in italian, so it might be slightly diffrent from usual error message.

Thanks guys!!

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Print error

Postby JoshM » 15 Jun 2015

I'm getting an error trying to output in a file.
I really can't understand what's going on, the code is just so simple that I don't understand where the problem could be.
I'm new to C#, and probably that is the real problem.
Hello, it looks like you're trying to use PowerLanguage keywords in MultiCharts .NET, which gives this error.

* An example of printing to a file can be found in this thread, but you can also output text to the PowerLanguage .NET Editor, just like the `Print()` keyword does in regular MultiCharts:

Code: Select all

Output.WriteLine("This message gets printed");
Output.WriteLine("Current bar close = {0}", Bars.Close[0]);
* The current bar's date and time are accessible with `Bars.Time[0]`, which returns a `DateTime` value that needs to be formatted to a string before it's readable like a regular date. See formatting date and formatting time for more on that.

ManuelVene
Posts: 17
Joined: 12 Jun 2015
Been thanked: 1 time

Re: Print error

Postby ManuelVene » 15 Jun 2015

Ah, yes that makes sense.

This means that the keywords documented in Multicharts wiki page are not available for .NET? Or at least not all of theme?
Is there a complete keywords list for .NET? In the entire wiki site I couldn't find any reference to the stuff used in the thread you linked (thank you so much that was exactly what I needed).

Cheers!!

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: Print error

Postby JoshM » 16 Jun 2015

This means that the keywords documented in Multicharts wiki page are not available for .NET? Or at least not all of theme?
That's true, the MultiCharts (PowerLanguage) keywords are different than the MultiCharts .NET keywords. Sometimes there is a resemblance between the names of keywords, but most often that's not the case, I'm afraid.
Is there a complete keywords list for .NET?
No, unfortunately not. You can search in the PowerLanguage .NET Editor's help file for certain things, but that help is primarily helpful if you already know how it's called. There's furthermore a programming guide (pdf) which covers a lot of topics, and there are also online MultiCharts .NET tutorials.

But of course if you want to know something, you can always ask on the forum. :)

ManuelVene
Posts: 17
Joined: 12 Jun 2015
Been thanked: 1 time

Re: Print error

Postby ManuelVene » 16 Jun 2015

Thank you so much mate, I really apappreciated your help!

:)


Return to “MultiCharts .NET”