[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 Cameron,
The problem with your code is a small syntax error.

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

Cameron, instead of "o tomorrow + ent stop", change it to "o tomorrow - ent 
stop".

HTH

Rgds,

Robert Bianchi
r.bianchi@xxxxxxxxx



 >Date: Wed, 21 Feb 2001 22:07:46 +1000
 >From: "Cameron Jones" <ctj@xxxxxxxxxxxxx>
 >To: <omega-list@xxxxxxxxxx>
 >Subject: entry and stop on the same bar problem
 >Message-ID: <NEBBIPBLEMIJBLLBFEJAIEJKCAAA.ctj@xxxxxxxxxxxxx>
 >Content-Type: text/plain;
 >charset="iso-8859-1"
 >Content-Transfer-Encoding: 7bit
 >MIME-Version: 1.0
 >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
 >