Previous Entry Share Next Entry
Back testing your trading ideas
forbusiness
Buy = Cross( MACD(), Signal() );

priceatbuy=0;

for( i = 0; i < BarCount; i++ )
{
if( priceatbuy == 0 && Buy[ i ] )
priceatbuy = BuyPrice[ i ];

if( priceatbuy > 0 && SellPrice[ i ] > 1.1 * priceatbuy )
{
Sell[ i ] = 1;
SellPrice[ i ] = 1.1 * priceatbuy;
priceatbuy = 0;
}
else
Sell[ i ] = 0;
}
Tags:

?

Log in

No account? Create an account