PureBytes Links
Trading Reference Links
|
Victor and Robert,
Now I see it...thank you for your replies...love your work.
>From: Victor C <victorc17@xxxxxxxxx>
>To: Jody Ellis <ellis_jody@xxxxxxxxxxx>, omega-list@xxxxxxxxxx
>Subject: Re: Position Sizing
>Date: Wed, 11 Jul 2001 02:22:50 -0700 (PDT)
>
>Jody,
>
>What is happening is that PositionProfit(1) will give
>you the profit of the last trade, but the if statement
>will be true on every bar after a wining trade is
>closed. So if trade #2 happens 15 bars after the 1st
>trade closed, then Num will have a value of 15, as 15
>bars went by where your if-then statement was
>evaluated true. What you want is something like:
>
> > Variables: Num(1), MarketPos(0);
> >
> > MarketPos = MarketPosition;
> > If PositionProfit(1) < 0 Then Num = 1;
> >
> > If MarketPos = 0 and MarketPos <> MarketPos[1] then
> > If PositionProfit(1) > 0 Then Num = Num + 1;
> >
> > Buy Num Contracts Blah Blah;
>
>This will increment Num by one only the bar after the
>trade is closed, or to be more exact, after
>marketPosition changes.
>
>Victor Cuadra
>www.cuadraE.com
>
|