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

Re: el question day of week statement



PureBytes Links

Trading Reference Links

Did anyone ever answer this one?

Sentinel:  I see what you're trying to do, but you're making life more
complex than it needs to be.  As Alfred Einstein said:  "Everything should
be made as simple as possible, but not simpler."

With that in mind, the first thing we want to do is eliminate the following
two statements from your code:

IF H > VALUE1 THEN VALUE1 = H;
IF L < VALUE2 THEN VALUE2 = L;


These statements aren't doing anything since Value1 has already been set to
H and Value2 has already been set to L.


Next thing we want to do is change our methodology for checking for a trend
in two time frames.  Forget about the day of the week statement.  All that
you are doing with that statement, the way you have it, is making the
calculations every Monday.  I don't think that this is what you're trying to
do.

What you want to do is insert a second set of your S&P data into your chart.
Call this Data2.  For this set of data, set compression to weekly.

Now you can use statements like:

If Close of data1> highest(Close of data1,10)[1] and Close of Data2 >
highest (Close of data2,10)[1] then buy;

If Close of data1<lowest(close of data1,10)[1] then exitlong;


to ensure that you have a trend in both time frames.  You can use up to 50
different data series in your analysis techniques, but be sure that the data
you wish to buy or sell is data1.



All the best,

Omega Man




-----Original Message-----
From: Sentinel Trading <rjbiiilis@xxxxxxxxxxxxx>
To: Omega-List <Omega-list@xxxxxxxxxx>
Date: Monday, August 03, 1998 10:11 PM
Subject: el question day of week statement


I added the following statement to a system while trying to include the
weekly
avg for daily data into a system to insure a trend in two time frames, It
increased the number of trades and greatly improved the returns on the SP
500
daily. The statement IF DAYOFWEEK(DATE) < DAYOFWEEK(DATE[1]) THEN BEGIN when
removed decreases returns with several stopped trades. Any insight would be
appreciated. I'm posting the whole system not the returns, I'd be interested
in
knowing anyone else tries backtesting it. If anyone requests I'll send the
ELA.
Thanks for any insight.
{***************************************************************************
****
*****************************}
{ I used Max Bars Back Defaulted at 50}



   input: stoploss(.0625),BuyZone(40),SellZone(60), LENGTH(5);

ARRAY:HARRAY[200](0),LARRAY[200](0);

IF DAYOFWEEK(DATE) < DAYOFWEEK(DATE[1]) THEN BEGIN

     VALUE4 = 0; VALUE5 = 0;

     HARRAY[LENGTH + 1] = VALUE1;
     LARRAY[LENGTH + 1] = VALUE2;

     FOR VALUE0 = 1 TO LENGTH BEGIN

          HARRAY[VALUE0] = HARRAY[VALUE0 + 1];
          LARRAY[VALUE0] = LARRAY[VALUE0 + 1];
          VALUE4 = VALUE4 + HARRAY[VALUE0];
          VALUE5 = VALUE5 + LARRAY[VALUE0];

     END;

     VALUE1 = H;
     VALUE2 = L;
     VALUE3 = 0;
     VALUE6 = ROUND(VALUE4 / LENGTH,2);
     VALUE7 = ROUND(VALUE5 / LENGTH,2);


IF H > VALUE1 THEN VALUE1 = H;
IF L < VALUE2 THEN VALUE2 = L;

end;
If currentbar > 1 and  DMIPlus(14) > DMIMinus(14) and ADX(14) > 35 and
  FastK(8) <= BuyZone and value6 > value6[1]
then begin Buy ("Long") High + .0625 stop;
end;

  ExitLong ("StopLoss") from entry ("Long") At$ Low - stoploss  stop;

   if FastK(8) crosses below 80 then exitlong;

{******************************************************************}

If CurrentBar >1 and  ADX(14) > 35 and DMIMinus(14) > DMIPlus(14) and
  FastK(8) >= SellZone and value7 < value7[1]

      Then begin Sell ("Short") Low - .0625 stop;
end;

ExitShort ("StopLossShort") from entry ("Short") At$ High + stoploss stop;


     If FastK(8) crosses above 20 then exitshort;






"The darkest hour in any man's life is when he sits down to plan
how to get money without earning it"

Sentinel Trading