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

entry and stop on the same bar problem



PureBytes Links

Trading Reference Links


Hi all...
I have just started learning easylanguage and have come across a most
frustrating problem.  My first backtesting trading system starts off well
enough but soon changes with my stoploss orders being triggered at the same
price as my entries.  My entries are correct but my stops are triggered same
bar same price. Even if I extend the stoploss to a ridiculous amount nothing
changes.  Sounds like I am doing something fundamentally wrong but I can't
find it.  Any suggestions ? omega platinum pro 2000i user.


This is my entry signal code

input:	malen(15), ent(1), mavdif(.05);
vars:	MA(0), Con(1);
MA = Average(Close, MALen);
{--------------ENTRY SIGNALS---------------------}
if the ma > ma of 1 day ago + mavdif and c < ma then buy ("long") con
contracts at o tomorrow + ent stop;

if the ma < ma of 1 day ago - mavdif and c > ma then sell ("short") con
contracts at o tomorrow + ent stop;




Exit is the basic stoploss at 2000$



Regards
Cameron