[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tj's pyramid



PureBytes Links

Trading Reference Links

thought y'all would be interested in TJ's sample pyramid code.

Hello,

Here is a simple sample of pyramiding "emulation":

// the example system buys on monday, wednesday (increasing pos)
// and sells on friday

BuyCond = DayOfWeek() == 1;
Buy2Cond = DayOfWeek() == 3; // pyramid

Sell = DayOfWeek()==5;

Buy = BuyCond OR Buy2Cond;
PositionSize = IIf( Buy2Cond, 2000, 1000 ); // 1000 is first trade 
2000 is pyramided
Sell = Sell OR Buy2Cond;

/////////////////
Please set trade delays to zero in the settings page.