PureBytes Links
Trading Reference Links
|
Thanks for your very help !
I have found out now, that trade.GetPositionValue() always returns the
amount without checking rounding through RoundLotSize !
In my example trade the result of GetPositionValue = 22346.4 as
displayed in the Debug Viewer. Without rounding the following code
below returns exactly 22.346 contracts. Is it a bug ? What do you mean
?
if(sig.IsEntry() && sig.IsLong() )
{
PosSize = sig.PosSize();
if(PosSize < 0)
PosSize = (-PosSize / 100) * bo.Equity;
Contracts = PosSize / sig.MarginDeposit ;
_TRACE("bar " + bar + " Contracts = " + Contracts );
2007/7/4, gp_sydney <gp.investment@xxxxxxxxx>:
>
>
>
>
>
>
> > i have checked out if it will be affected by the O, H, L, C AA
> > Settings, but this wasn't the case
>
> Not if you have buy and sell set to Close, otherwise I think it will
> (certainly does with mine).
>
> The signal list contains all signals generated by the Buy and Sell
> arrays whether they're ultimately taken or not.
>
> Also note in your code that GetPositionValue returns a single number,
> not an array, so you don't need "posval[bar]", just "posval". Still
> seems to work the same though.
>
> GP
>
> --- In amibroker@xxxxxxxxxxxxxxx, "Trinolix Derry" <trinolix@xxx> wrote:
> >
> > Hi,
> >
> > i have checked out if it will be affected by the O, H, L, C AA
> Settings,
> > but this wasn't the case. I have set commission to zero in my code,
> so this
> > also doesn't seem to be the reason. Hmm, strange, but very important.
> >
> > Maybe your or someone else can clarify: Returns the signal object
> already
> > signals which AmiBroker would execute in the next phase or are this ONLY
> > potential signals and AmiBroker decides through certain rules if
> they are
> > executed or not.
> > I haven't found anything in the help about that.
> >
> >
> > Regards
> >
> >
> >
> >
> > 2007/7/4, gp_sydney <gp.investment@xxx>:
> > >
> > > From a bit of experimenting, I think a couple of reasons.
> > >
> > > The main reason is that GetPositionValue seems to use the closing
> > > price when calculating the value, whereas the AA display will use
> > > whatever your settings say (eg. open, high, average).
> > >
> > > The other reason is that the AA display will have subtracted the sale
> > > brokerage, if you have any set, whereas the open position trade won't
> > > have yet.
> > >
> > > Regards,
> > > GP
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx <amibroker%40yahoogroups.com>,
>
> "Trinolix
> > > Derry" <trinolix@> wrote:
> > > >
> > > > Hello,
> > > >
> > > > i am wondering that the Position Size Value that i see with the
> > > Debug Viewer
> > > > is different than the one that AmiBroker displays in the AA report
> > > list. I
> > > > have tried it also on a single trade and just the first few bars
> of the
> > > > trade. Does anyone know the reason ?
> > > >
> > > >
> > > > *for*(bar = 0; bar < *BarCount*; bar++)
> > > > {
> > > > bo.ProcessTradeSignals(bar);
> > > > CurEquity = bo.Equity;
> > > > **
> > > > *for*( pos = bo.GetFirstOpenPos(); pos; pos = bo.GetNextOpenPos() )
> > > > {
> > > > posval = pos.GetPositionValue();
> > > > _TRACE("bar " + bar + " GetPositionValue = " + posval[bar] );
> > > > }
> > > >
> > > >
> > > > --
> > > > Regards
> > > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > Regards
> >
>
>
>
>
>
--
Regards
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/amibroker/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/amibroker/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:amibroker-digest@xxxxxxxxxxxxxxx
mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx
<*> To unsubscribe from this group, send an email to:
amibroker-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|