Indicates the last unusual price deviation in historical and live price data. Automatically set by calling a price or contractUpdate function. Can be evaluated in scripts; afterwards reset it to 0 for 'arming' it for the next price deviation detection.

0 - No price jump since the last reset.
1 - Price outlier, see below.
2..10 - Stock split by the given factor, f.i. 4 for a 4:1 stock split.




Sensitivity factor of the outlier detection for historical and for live prices (default = 1+2*sqrt(BarPeriod/1440)). All outliers above the given factor or below its reciprocal are suppressed with a 0.01 EMA factor. For instance, Outlier = 1.15; suppresses all outliers that deviate from the last price by more than 15% in any direction. PriceEvent is set to 1 when an outlier was detected. Negative ask-bid spreads are suppressed. Set this to 0 for not fixing splits, outliers, and negative spread, and to 2 or above for treating splits as outliers. 




function run()

  Outlier = 1.05;  // detect and suppress price deviations by more than 5%
  if(PriceJump >= 2) { // stock split detected 
    printf("\nStock split %i:1 - cancelling open contracts",PriceJump);
    for(open_trades) cancelTrade(ThisTrade);
    PriceJump = 0;

See also:

tick, TickTime, price


► latest version online