MC equivalent of EL "TradesToday" ?

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

MC equivalent of EL "TradesToday" ?

Postby sptrader » 17 Aug 2010

I'm trying to limit the trades on a given day to 1 or 2 and can't find the EL "tradestoday" reserved word in MC- is there an equivalent in Multicharts ?
(or has someone written a graceful function to do the same thing ?)

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: MC equivalent of EL "TradesToday" ?

Postby SP » 18 Aug 2010

Code: Select all


[LegacyColorValue = true];

{
User Function: TradesToday

Inputs : Target date.
Returns: Number of entries on specified date.
Properties
[ ] Auto Detect
[*] Simple
[ ] Series

Sample Usage :
if (TradesToday(Date[0]) >= 2)
then EntryOK = FALSE ;
or
if (Condition1 and Condition2 and TradesToday(Date[0]) < 2)
then begin
{ ... do something here ... }
end ;

Provided by Product Support Dept.
of Omega Research, Inc.
}

Inputs: Date0(NumericSimple) ;
Vars : Loop(0), Cnt(0) ;

Cnt = 0 ;
for Loop = 0 to 10 begin
if (EntryDate(Loop) = Date0)
then Cnt = Cnt + 1 ;
end ; { next Loop }

TradesToday = Cnt ;



sptrader
Posts: 742
Joined: 09 Apr 2010
Location: Texas
Has thanked: 483 times
Been thanked: 274 times
Contact:

Re: MC equivalent of EL "TradesToday" ?

Postby sptrader » 18 Aug 2010

Perfect, thanks !

zero123
Posts: 4
Joined: 04 Oct 2012

Re: MC equivalent of EL "TradesToday" ?

Postby zero123 » 04 Oct 2012

I am getting Compile error with the above code in MC8.

Any idea?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: MC equivalent of EL "TradesToday" ?

Postby TJ » 04 Oct 2012

I am getting Compile error with the above code in MC8.

Any idea?
You have to post a screenshot of your error message.

zero123
Posts: 4
Joined: 04 Oct 2012

Re: MC equivalent of EL "TradesToday" ?

Postby zero123 » 04 Oct 2012

04.10.12 10:16:37
------ Build started: ------
Study: "TradesToday" (Function)
Please wait ....
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: MC equivalent of EL "TradesToday" ?

Postby TJ » 04 Oct 2012

04.10.12 10:16:37
------ Build started: ------
Study: "TradesToday" (Function)
Please wait ....
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)
What is the function name you are using?

It should be "TradesToday".

zero123
Posts: 4
Joined: 04 Oct 2012

Re: MC equivalent of EL "TradesToday" ?

Postby zero123 » 04 Oct 2012

I am not using any function, just trying to compile the above code and getting the error with the compile process.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: MC equivalent of EL "TradesToday" ?

Postby TJ » 04 Oct 2012

I am not using any function, just trying to compile the above code and getting the error with the compile process.
The above code is a function.
When you add it to the PowerLanguage Editor, please select it as a function.

zero123
Posts: 4
Joined: 04 Oct 2012

Re: MC equivalent of EL "TradesToday" ?

Postby zero123 » 04 Oct 2012

I did add it as a function. Just can't seem to compile it, getting the same error message.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: MC equivalent of EL "TradesToday" ?

Postby TJ » 04 Oct 2012

I did add it as a function. Just can't seem to compile it, getting the same error message.
What is the name you used for this function?

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: MC equivalent of EL "TradesToday" ?

Postby Henry MultiСharts » 05 Nov 2012

04.10.12 10:16:37
------ Build started: ------
Study: "TradesToday" (Function)
Please wait ....
------ Compiled with error(s): ------
Compile error
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)
If you are unable to compile an empty study then please follow this guide.


Return to “User Contributed Studies and Indicator Library”