Hello, thanks a lot to both of you ! This was really very helpful.
Regards 2007/7/5, gp_sydney <[EMAIL PROTECTED]>:
As Tomasz said, save those values using temporary variables: VarSet("Entry"+trade.Symbol, trade.GetEntryValue()); and then later retrieve with VarGet. Would be kinda nice though if there were some spare variables in the Trade object, to keep it all nice and object-oriented. GP --- In amibroker@yahoogroups.com <amibroker%40yahoogroups.com>, "Trinolix Derry" <[EMAIL PROTECTED]> wrote: > > Thanks, yes, you are right. > > Currently i see no chance to get some values from the very first bar of a > trade, like contracts at entry, Initial position size, etc.. > When any Scale Out or In is made during a trade, than the > trade.GetEntryValue, trade.Shares, etc.. are no more correct, because > AmiBroker builds an average. So i have no idea how i could store the > original values at entry for further use during the trade, even scaling > compared to original position size, etc... > I have a lot of work for which i need those values at entry. It's a shame > that i don't have any option to retrieve them. > > On the other side i could get the original values in the signal object, but > as we know now, it could be possible that trades are not really made. So i > think this would also not be a solution. > > Do you know any way ? It's really a shame, but it seems to be not possible > in AmiBroker. > > Regards > > > > > > 2007/7/4, gp_sydney <[EMAIL PROTECTED]>: > > > > Further to #5, also minimum shares, minimum position value, and allow > > position size shrinking if available cash is too small for minimum > > position. Commission value could affect this as well. > > > > GP > > > > --- In amibroker@yahoogroups.com <amibroker%40yahoogroups.com><amibroker%40yahoog roups.com>, "Trinolix > > Derry" <trinolix@> wrote: > > > > > > Can you maybe tell me some reasons which would result that AmiBroker > > doesn't > > > take signals from the signal object ? > > > Basically my code already removes additional signals through exrem > > function > > > and my trading loop. > > > > > > So i think the following list should cover all conditions in which AB > > > wouldn't take signals: > > > > > > 1.) AA Settings: Max. Open Positions > > > 2.) AA Settings: Usage of build-in Stops > > > 3.) AA Settings: Usage of build-in Trade delays > > > 4.) AA Settings: General Tab: Activate Stops immediately, Reverse entry > > > signal forces exit and Allow same bar exit. > > > 5.) Equity during backtest already negative. > > > > > > > > > > > > 2007/7/4, gp_sydney <gp.investment@>: > > > > > > > > > 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@yahoogroups.com <amibroker%40yahoogroups.com> <amibroker%40yahoogroups.com><amibroker%40yahoog > > roups.com>, > > "Trinolix > > > > Derry" <trinolix@> 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@>: > > > > > > > > > > > > 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@yahoogroups.com <amibroker%40yahoogroups.com><amibroker%40yahoog roups.com> > > <amibroker%40yahoogroups.com><amibroker%40yahoog > > > > roups.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 > > > > > > > > > > > > > -- > Regards >
-- Regards