It is semantics. The last signal you get will be the last one in the last n days, even if you have a signal every day. The chart is revealed day by day and it shows you where the condition exists. I can't figure out why you are using flip and it seems to make no difference when I comment it out.
Plot the following and look at it: plot(H, "C", colorred); plot(L, "L", colorred); plot(HHV(H,20), "HHV", colorblue); plot(LLV(L,20), "LLV", colorblue); plotshapes(buy * shapeuparrow, colorgreen); plotshapes(sell * shapedownarrow, colorred); This will show you where the signals come. Your formula simply tells you when the high crosses above the high of the last 20 days. It can do that every other day. Ditto with the low. Barry --- In [email protected], "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > I suppose I could have been more specific. I've played with it a > little and here is the last code I've tried: > > Buy=Cross(H,Ref(HHV(H,20),-1)); > Sell=Cross(Ref(LLV(L,20),-1),L) ; > Short=Sell; > Cover=Buy; > intrade=Flip(Buy,Sell); > Filter=Buy OR Sell; > AddColumn( Buy, "BuySig", 1.0 ); > AddColumn( Sell, "SellSig", 1.0 ); > > What I'm getting is every signal over the n-days I enter. What I'm > looking for is just the last signal over n-days. > > Thanks for your response it's appreciated!! > > --- In [email protected], "Barry Scarborough" <razzbarry@> > wrote: > > > > Reading between the lines, I guess you are using AddColumn and the data > > displayed isn't what you want. The filter can be the problem. If you > > use buy and sell and that is not the trade signal then use something > > else as the filter. > > > > If the price is wrong then set the price at the time of the trade is > > buyprice, sellprice, etc, and use those variables as your filter. You > > can also use writeif and use the trade signal as the condition. > > > > If I did not read between the lines correctly letting us see the code > > would help. > > > > Barry > > > > --- In [email protected], "zim630@" <zim630@> wrote: > > > > > > I am trying to run a trading system I have in exploration against > > > differing lists of stocks. I am getting the raw signals and not the > > > Trade signals which is what I'd like to have. I've tried to search > > > the board but yahoo must be having problems today as all I seem to get > > > is server is not responding. > > > > > > Thanks in advance for any help. > > > > > > Bill > > > > > >
