DailyWinners (Function)
The DailyWinners function returns the number of winning strategy positions that were taken throughout the specified date.
Syntax
DailyWinners(TargetDate_YYYMMDD)
Returns (Integer)
The number of winning strategy position entries on a date.
Parameters
Name | Type | Description |
TargetDate_YYYMMDD | Numeric | Sets the target date, entered in the format "YYYMMDD" or a date related function or calculation. |
Remarks
The DailyWinners function only works in a Strategy or a Function called from within a Strategy and it will not work in any other indicator or analysis technique study type. The function is limited to looking back 10 positions, so the maximum number of DailyWinners that could be reported is 10, if the last ten trades of the target date were winners.
The input parameter TrgtDate can be a constant value like; 1020601 (6-1-2002), where 102 = 2002, 103 = 2003, 99 = 1999, and so on. It can also reference date related keywords like date (which returns the current bar date), and CurrentDate, (which returns the datafeed date.)
Examples
Assigns to Value1 the number of winning trades throughout each day in the chart:
Value1 = DailyWinners (Date);
Assigns to Value1 the number of winning trades throughout the current day only and checks for three winning trades:
Value1 = DailyWinners (CurrentDate);
if Value1 = 3 then …