Ice Cream sample

The source for Ice Cream setup

Ice Cream description

The famous Ice Cream setup from Fxtime in TradingFloor is based on system counting daily raising lows and falling highs.

We need certain amount of raising lows or falling highs before trade entry is allowed.

Counting converts to straightforward and simple C language algo function. We compare current value to previous value and increase counter until criteria is not true anymore.

We use i as index. LookBack(i) means current value and LookBack(i+1) previous value. We break out from loop when criteria is not true anymore.

Low.LookBack(i) > Low.LookBack(i+1) counts amount of raising lows. High.LookBack(i) < High.LookBack(i+1) counts amount of falling highs.

We store value of _raisingLows and _fallingHighs variable so that those can be used to check if trade entry criteria is fulfilled.


public override void NewDailyBar(object sender, SingleBarEventArgs args)
{
        if ( _currentBar < _leadBars ) // Need enough bars to start counting back
            return;

        _raisingLows = 0;
        for ( int i = 0; i < 100; i++)
        {
            if ( Low.LookBack(i) > Low.LookBack(i+1) )
                _raisingLows++;
            else
                break;
        }
        _fallingHighs = 0;
        for ( int i = 0; i < 100; i++)
        {
            if ( High.LookBack(i) < High.LookBack(i+1) )
                _fallingHighs++;
            else
                break;
        }
}

Then we check if _raisingLows or _fallingHighs exceed our trade entry criteria to justify opening position. Variable _tradeAllowed is used to filter trade entry. More about filters later.



public override void NewTick(BarData partialBar, TickData tick)
{
    if ( _fallingHighs > 5 && _tradeAllowed == true )
    {
        OpenPosition(settings);
    }
    else if ( _raisingLows > 5 && _tradeAllowed == true )
    {
        OpenPosition(settings);
    }
} // NewTick