PureBytes Links
Trading Reference Links
|
Could someone please tell me why the following code for exits on 1 minute
bars for the S&P e-mini don't work. The exits after entry bar exit on
wrong values, and the entrybar exit gets me out at the entryprice.
Any help will be appreciated.
Barry Silberman
============================================================================
=======================
{to exit on bar after entrybar}
Inputs: profitpoints(2);
variable: profitval_long(0), profitval_short(0);
If open <> 0 then begin
profitval_long = entryprice + profitpoints;
profitval_short = entryprice - profitpoints;
end;
if Marketposition <> 0 then begin
sell("profit-LX") next bar at profitval_long stop;
buytocover ("profit-SX") next bar at profitval_short stop;
end;
{to exit on entry bar}
Variable: entrypoint_Long(0), entrypoint_short(0), EB_Exit_lg(0),
EB_Exit_Short(0);;
entrypoint_long = Max_High + .1;
entrypoint_short = Min_Low - .1;
EB_Exit_lg = entrypoint_long + profitpoints;
EB_Exit_Short = entrypoint_short - profitpoints;
If marketposition = 0 then
sell("EB-LX") next bar at EB_Exit_lg stop;
If marketposition = 0 then
buytocover ("EB-SX") next bar at EB_Exit_Short stop;
|