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

Re: also...



PureBytes Links

Trading Reference Links

Maybe try to save the stop value in a separate variable as in:

Vars:  PyramidEntry(-1), PyraSave(0);
IF CurrentEntries = 2 then begin
   PyramidEntry = PyramidEntry + 1;
   IF PyramidEntry[1] = 0 then PyraSave = Open[0];
end;
IF CurrentEntries =1 then PyramidEntry = -1;
condition3 = PyramidEntry >= 0;

    {PYRAMID STOP LOSS}

IF condition3 then begin
PyraStop = PyraSave - (ATR * ChanLen);
end;

Bob Fulks

>In a message dated 11/08/2000 4:51:34 AM Pacific Standard Time,
>bfulks@xxxxxxxxxxxx writes:
>
><< You might be saying something like:
> 
>   BarCount = BarCount + 1;
>   if XXX then BarCount = 0;
>     .....
>   PastHigh = High[BarCount];
> 
> At some point the BarCount variable could get up to some big number. Look at
>every case where you refer back to a past value and make sure the look back
>is limited to same value, independent of the data.
> 
> Bob Fulks >>
>
>Yes, Bob, I am doing something just like that.  I use it to lock in the price
>of a pyramided entry, so I can then caculate stops, exits etc. from that
>price.  So I think my code is...
>
>Vars:  PyramidEntry(-1);
>IF CurrentEntries=2 then PyramidEntry= PyramidEntry + 1;
>IF CurrentEntries=1 then PyramidEntry= -1;
>condition3= PyramidEntry>=0;
>
>    {PYRAMID STOP LOSS}
>
>IF condition3 then begin
>PyraStop = Open[PyramidEntry] - (ATR * ChanLen);
>end;
>
>So how do I fix this?  I think you are saying that my "Open[PyramidEntry]" is
>causing the problem.  That the pyramidentry counter just keeps counter higher
>and higher.  I was under the impression (perhaps assumtion) that the counter
>was resetting itself.  But maybe it's not.  I better look at the code closer
>and maybe just add some code that resets the variable.  Does that sound right
>to you?
>Thanks a lot!
>Jim