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 ?)
MC equivalent of EL "TradesToday" ?
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 ;
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
You have to post a screenshot of your error message.I am getting Compile error with the above code in MC8.
Any idea?
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
What is the function name you are using?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)
It should be "TradesToday".
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
The above code is a function.I am not using any function, just trying to compile the above code and getting the error with the compile process.
When you add it to the PowerLanguage Editor, please select it as a function.
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
What is the name you used for this function?I did add it as a function. Just can't seem to compile it, getting the same error message.
- Henry MultiСharts
- Posts: 9165
- Joined: Aug 25 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
If you are unable to compile an empty study then please follow this guide.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)