| Trading Indicators Post your custom trading indicators. If you download, remember to click INSTALL. |
![]() | | Tweet | |
Januson Function Library Details »» | ||||||||||||||||||||
This is a collection of small and usefull functions from my library. I'll just post them as I write or review old ones ![]() I'm using MultiCharts, but I'm almost sure that tradestation users can compile them without any problems as both supports EasyLanguage. ************************* ** Function: JK_Math_RoundToNearest Just a small function from my library. I've discovered that RangeBars can give some funny open and closing values that needs to be comformed correct in order to write a pattern recognizer. Code: //FunctionName: JK_Math_RoundToNearest //Summary: A small function invented for rounding numbers to nearest precision i.e. round 100.27 to 100.25 or 95.86 to 95.75 //Author: Januson Nov2008, rev.0 //Example: JK_Math_RoundToNearest(100.58, 0.25) -> 100.50 inputs: valueToRound(NumericSimple), nearestFraction(NumericSimple); begin var: double PRECISION(10000); //constant JK_Math_RoundToNearest = IntPortion(valueToRound) + (round((fracportion(valueToRound)* PRECISION) /(nearestFraction * PRECISION), 0) * (nearestFraction * PRECISION))/PRECISION; end; Example from indicator: if condition1 and condition5 then begin ... yada yada print(JK_BarDateTime, condition1, valueXX); end; I can then use the output window to track debug info quite easily ![]() Code: //FunctionName: JK_BarDateTime //Summary: A function to convert the EasyLanguage datetime information from current bar //Author: Januson Oct2008, rev.0 //Example: Print(JK_BarDateTime); JK_BarDateTime = DateTimeToString(datetojulian(date) + ELTimeToDateTime_s(Time_s)) ; Show Your Support
| ||||||||||||||||||||
| The Following User Says Thank You to januson For This Useful Post: | ||
Tams (08-09-2010) | ||
![]() |
| Thread Tools | |
| Help Others By Rating This Thread | |
| |
| ∧ Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can function in TS8 return array? | ImXotep | Technical Analysis | 5 | 05-25-2009 02:13 AM |
| "Rebase" function in Tradestation | dupaski | Brokers and Data Feeds | 13 | 09-20-2008 08:12 PM |