Global variables in EL

Questions about MultiCharts and user contributed studies.
Victor

Global variables in EL

Postby Victor » 05 Dec 2006

It looks like some gloabal variables like EntryPrice, BarsSinceEntry, BarsSinceExit do not keep thier values across different studies, actually they are always equal to 0.

Please, confirm, that you are aware of these bugs in EL and it is on your list to fix.

Thanks
Victor

Chris
Posts: 150
Joined: 17 Nov 2005

Postby Chris » 05 Dec 2006

Victor,

these are normal reserved words and no Global Variables, so they should work only in the strategy calling them and not across different studies.

Chris

Victor

Postby Victor » 07 Dec 2006

Every Reservce word has its meaning, otherwise what is being reserved for!?

BarNumber is also reserve word, but it has value.

Could, Please, somebody from MC support answer my question.

Thanks
Victor

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 09 Dec 2006

Dear Victor,

What is your version of MultiCharts?

Victor

Global Variables

Postby Victor » 11 Dec 2006

I use your latest beta version from October the 6th.

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 11 Dec 2006

These problems are already fixed in the next beta that we are planning to release this week.

Victor

Global Variables

Postby Victor » 11 Dec 2006

Thanks a lot for good news!

Victor

Global Variables in New beta

Postby Victor » 20 Dec 2006

Dear Support.

I downloaded new beta release - it is fantastic, Thanks you! But I still have issues with BarsSinceExit, BarsSinceEntry reserve keywords.

In new beta they have thier values correct. However they have the value only on that signal, which actually Exits (Enters) trade. On other signals those values are '0'. So BarsSinceEntry and BarsSinceExit do not keep values acrooss studies.

Is it behavour that supposed to be? I am not sure now?

Chris
Posts: 150
Joined: 17 Nov 2005

Re: Global Variables in New beta

Postby Chris » 20 Dec 2006

Dear Support.

I downloaded new beta release - it is fantastic, Thanks you! But I still have issues with BarsSinceExit, BarsSinceEntry reserve keywords.

In new beta they have thier values correct. However they have the value only on that signal, which actually Exits (Enters) trade. On other signals those values are '0'. So BarsSinceEntry and BarsSinceExit do not keep values acrooss studies.

Is it behavour that supposed to be? I am not sure now?


Victor, that is the supposed behaviour, because these reserved words are no Global Variables. So you will only have their value in the one study entering/exiting the trade and not in a different strategy. What you can do is using Global Variables, PushPop or EasyLanguage Collections to save this value for Entryprice etc. and make it available for other studys to call it.

Chris

Guest

Postby Guest » 20 Dec 2006

Chris:

can you give an example how to pass variable from one study to another?

e.g. I have a MACD and a Stochastic, if both are over 80, I want a sell signal. How can this be done?

User avatar
Kate
Posts: 758
Joined: 08 Dec 2006

Postby Kate » 20 Dec 2006

Thank you, Chris, for your explanation. You are absolutely right.

Chris
Posts: 150
Joined: 17 Nov 2005

Postby Chris » 20 Dec 2006

Chris:

can you give an example how to pass variable from one study to another?

e.g. I have a MACD and a Stochastic, if both are over 80, I want a sell signal. How can this be done?


I guess the easiest way would be to include the MACD and Stochastic in your strategy. If you are using different time frames (or symbols) then add additional data streams. You can find a brief explanation in the EL reference guides.

Chris

Victor

Postby Victor » 31 Dec 2006

Hi, Dear MC support.

I spent some time to figure out the behavor of EntryPrice, BarsSinceEntry and BarsSinceExit.

I figured out, that both EntryPrice and BarsSinceEntry work perfect and both keep thier values across Signals (if Signals have status ON).

However, BarsSinceExit always '0' even on the same signal where exit took place. BarsSinceExit doesn't seem to be working in new beta release.

Or I do not understand what this Global variable shows, either it is still a bug.

Please, confirm, you are aware of that.

Thanks, Victor

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 01 Jan 2007

BarsSinceExit always '0' even on the same signal where exit took place. BarsSinceExit doesn't seem to be working in new beta release.

Or I do not understand what this Global variable shows, either it is still a bug.

Please, confirm, you are aware of that.

Thanks, Victor


Dear Victor,

This is the way BarsSinceExit works. It returns the number of bars since the specified exit and it always returns 0 if you use it without parameter because the current position is still open. You have to use BarsSinceExit(1) to receive a number of bars since the exit that occurred one position ago.

Victor

Postby Victor » 02 Jan 2007

I did that and got error: Position index 1 is out of bounds. From other message thread I've read that you are preparing new beta within this week where this problem will go away!? It is still within this week?

Thanks a lot for your help!

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 03 Jan 2007

I did that and got error: Position index 1 is out of bounds. From other message thread I've read that you are preparing new beta within this week where this problem will go away!? It is still within this week?

Thanks a lot for your help!


Yes, we are going to change this as you correctly mentioned. We are on holidays returning Jan 9, we will release the new beta version after that.

Victor

Postby Victor » 10 Feb 2007

Dear MC Support.

BarsSinceExit(1) works perfectly in new beta. But I still have problems with passing ddata between strategies, Signals and functions.

You said, we can use PushPop functions, but I don'e see them in EL. You also talked about EL Collections!?

Could you, Please, give any examples on how to use EL Collections or Push/Pop functions or any reference to that.

Thanks a lot.
Victor

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 12 Feb 2007

Victor, you can find the complete information regarding the EL Collections here:
https://www.TS.com/Discussion ... c_ID=33397

I'm also attaching the documentation.
Attachments
ELCollections.doc
(113 KiB) Downloaded 215 times


Return to “MultiCharts”