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

EL code for Pyramiding



PureBytes Links

Trading Reference Links

Is there some special method for adding more entries in easylanguage?

Here is the code for a simple channel breakout system that tries add 1 contract if the open profit is more than 20 points:

Inputs: ChannelEntry(5), Chexit(5);

Buy ("CBL") Next Bar at HighestFC(High, ChannelEntry) + 1 Point Stop;

Sell ("CBS") Next Bar at LowestFC(Low, ChannelEntry) - 1 Point Stop;	

IF MarketPosition = 1 then exitlong at LowestFC(Low, Chexit) - 1 Point Stop;

IF MarketPosition = -1 then exitshort at HighestFC(High, Chexit) + 1 Point Stop;

{ The next 2 lines provide for the pyramiding }

IF MarketPosition = 1 and close - entryprice > 20 then Buy ("CBLPyr") Next Bar at HighestFC(High, ChannelEntry) + 1 Point Stop;

IF MarketPosition = -1 and entryprice - close > 20 then Sell ("CBSPyr") Next Bar at LowestFC(Low, ChannelEntry) - 1 Point Stop;

What happens is after the firt entry, the second entry is added on the next bar itself, but I want it to come in only if the profit is more than 20.

Any help would be appreciated.

Sudarshan