Rule Scripting - (f.*) Functions
Available functions and their parameters are shown. Functions can be used both in operands and for the parameters of commands and other functions, i.e. can be nested. Functions should be specified with any parameters in brackets and multiple parameters should be separated by a semi-colon.
- f.arPrctOrPipsToPips: Average Range or Pips to Pips
Accepts either daily range percentage or pips and returns just the pips. The daily range percentage is the percentage of pips that the associated symbol normally moves per day. - value: Specify daily range percentage using % sign, e.g. 20%, or will just be treated as pips
- f.avgRangePrct: Average Range Percentage
Average daily/true (depending on configuration) range, expressed as percentage already done for the day - f.bitCount: Return number of binary bits that are set in the supplied value
- value: Value to be examined
- mask: Optional bit mask to be applied to value. Set bits to be included. If blank then no mask will be applied.
- f.candleClosePipProfit: Candle Close Pip Profit
Returns the pip profit based on the candle close price and the trade open price. Will return warning message if trade not open. Profit is after the affect of the spread. - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- shift: Shift back relative to current bar/candle. Default is 1 (most recently closed candle).
- f.candleHigh: Candle High Price
Returns candle high price form chart data - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- shift: Shift back relative to current bar/candle. Default is 1 (most recently closed candle).
- f.candleLow: Candle Low Price
Returns candle low price form chart data - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- shift: Shift back relative to current bar/candle. Default is 1 (most recently closed candle).
- f.candleOpen: Candle Open Price
Returns candle open price form chart data - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- shift: Shift back relative to current bar/candle. Default is 1 (most recently closed candle).
- f.constrainSLPrice: Constrain Stop Loss Price
Will ensure that a supplied stop loss price is within a supplied min/max from the current bid price - price: Stop loss price to be constrained
- minDailyRangePrctOrPips: Minimum pips either as a percentage of daily range (using % sign, e.g. 20%), or pips if no % sign present. Default is blank, i.e. no minimum constrain.
- maxDailyRangePrctOrPips: Maximum pips either as a percentage of daily range (using % sign, e.g. 20%), or pips if no % sign present. Default is blank, i.e. no maximum constrain.
- offsetPips: Additional pips to add to price to make stop loss larger (prior to min/max constraint). If negative then would reduce stop loss. Default is blank, i.e. no offset.
- f.iMA: Moving Average
Calculates moving average from the runwiseFX built-in chart data. The configuration value chartBars needs to be a least twice the specified period. - method: Method of calculating, e.g. exponential, plus price to base on, e.g. close, high, etc.
- timeframe: Timeframe of chart to calculate moving average over. Default is -1 (timeframe set in Central Control tab).
- period: Averaging period for the calculation. Must be no more than half of the value set for the chartBars configuration value.
- f.invert: Invert Value
Will multiply supplied value by -1 - value: Value to be inverted. Can be floating point number.
- f.nextNewsDescr: Description of Next News
Returns description of next news item that affects the symbol. If multiple events at the same time then will return the highest impact ones. - impacts: Comma separated list of impacts interested in, e.g. LOW,MED,HIGH
- inclEVents: Comma separated list of additional events to include, regardless of impact
- exclEVents: Comma separated list of events to exclude
- f.nextNewsMins: Number of Mintues to Next News
Returns number of minutes to next news item that affects the symbol. If multiple events at the same time then will return the highest impact ones. - impacts: Comma separated list of impacts interested in, e.g. LOW,MED,HIGH
- inclEVents: Comma separated list of additional events to include, regardless of impact
- exclEVents: Comma separated list of events to exclude
- f.nextNewsSecs: Number of Seconds to Next News
Returns number of seconds to next news item that affects the symbol. If multiple events at the same time then will return the highest impact ones. - impacts: Comma separated list of impacts interested in, e.g. LOW,MED,HIGH
- inclEVents: Comma separated list of additional events to include, regardless of impact
- exclEVents: Comma separated list of events to exclude
- f.numCandles: Number of Candles
Returns number of candles between two times - time1: Should be the later time
- time2: Should be the earlier time
- f.pipDiffAuto: Pip Difference Auto
Returns the difference between two supplied prices, i.e. price1 - price2, in the form of pips. Auto means that it will do price2 - price1 if evaluating for a sell. - price1: Price 1
- price2: Price 2
- f.priceAddPipsAuto: Price Add Pips Auto
- f.priceAddPipsAuto: Will add the supplied number of pips from the supplied price if evaluating for a buy, and subtract pips if evaluating for a sell
- price: Price to be adjusted
- pips: Number of pips to be adjusted by
- f.priceAddPipsAuto: Price Add Pips Auto
- f.priceAddPipsAuto: Will add the supplied number of pips from the supplied price if evaluating for a buy, and subtract pips if evaluating for a sell
- price: Price to be adjusted
- pips: Number of pips to be adjusted by
- f.priceSubPipsAuto: Price Subtract Pips Auto
- f.priceSubPipsAuto: Will subtract the supplied number of pips from the supplied price if evaluating for a buy, and add pips if evaluating for a sell
- price: Price to be adjusted
- pips: Number of pips to be adjusted by
- f.priceSubPipsAuto: Price Subtract Pips Auto
- f.priceSubPipsAuto: Will subtract the supplied number of pips from the supplied price if evaluating for a buy, and add pips if evaluating for a sell
- price: Price to be adjusted
- pips: Number of pips to be adjusted by
- f.riskRewardPrice: Price that represents supplied risk reward
Returns open price (or current price if not open) offset by the number of pips risked, i.e. based on hidden stop loss at trade open - ratio: Risk reward ratio to use
- f.scaleValToBounds: Scale value to supplied min/max bounds
- valToScale: Value to be scaled
- inMin: Minimum value of input
- inMax: Maximum value of input
- outMin: Minimum value of output
- outMax: Maximum value of output
- f.swingAuto: Swing High/Low Price
For buy will return swing low and for a sell will return swing high. Intended for setting a stop loss price. - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- minPips: Minimum number of pips from current price to return. Default is no minimum will be applied.
- f.swingHigh: Swing High Price
Returns the price of the most recent swing high - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- minPips: Minimum number of pips from current price to return. Default is no minimum will be applied.
- f.swingLow: Swing Low Price
Returns the price of the most recent swing low - timeframe: Timeframe of chart to return price from. Default is -1 (timeframe set in Central Control tab).
- minPips: Minimum number of pips from current price to return. Default is no minimum will be applied.
