PureBytes Links
Trading Reference Links
|
Hey Thomo
This is how I do it . . .
Vars: Position(0), InitialBar(0);
{assume buy condition met and you go long on the current bar}
Position = MarketPosition;
If Position = 1 then begin
If Position[1] <> 1 then InitialBar = Barnumber;
{insert your own code here eg exits}
end;
Later
PC
Donald Thompson wrote:
>
> List,
>
> I am having a difficult time in anchoring and keeping as a varible value
> a bar number in an intraday context., at least I think that is the
> problem.
>
> I have the following:
>
> If x[1]< y[1] and x > y then buysignal =1 else buysignal =0;
> (Should I put an end; here?)
>
> If buysignal =1 then Buy blah blah at next bar market;
>
> {Here is where I want to start setting varible to enable doing some
> barnumber arithmetic to calculate highs and lows reletive to the buy
> signal.)
>
> If buysignal = 1 then begin
> If BuySignal =1 then LongPositionBarNumber = currentbar;
> CurBar = currentbar;
> xyz varibles.....
>
> I assume that if buysignal = 1 and there after it is zero then
> I assume that LongpositionBarNumber will remain the same value.
> as buysignal stays at zero.
>
>
> Would appreciate any assistance..
>
> Don Thompson.
|