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

[amibroker] Question about staticvarset + recall in backtester



PureBytes Links

Trading Reference Links

Hi,

I am trying to store in static variables on my entry days what the
long entry level should be to be recalled from custom backtester. I
converted all the signals from buy to sigscalein (because buy strips
out all future entry signals). Basically, the first buy shows up as a
buy and the rest show up as sigscalein (I used
buy=iif(buy,sigscalein,false);)

Anyway,in my code I have:

StaticVarSet(Name()+ValueWhen(Buy OR
sigScaleIn,DateNum()),LastValue(ValueWhen(Buy OR
sigScaleIn,Longtriggerlevel)));

I used lastvalue in the above because without it wont take
longtriggerlevel because its an array. The lastvalue converts it to an
integer.

Basically it should store the value as a the symbol name, plus the
date (in numeric format). This would be the level the stock would have
to reach for a buy to be initiated.

Then, from custom backtester to recall the value I have:

eval=VarGet(sig.symbol+DateNum()));

However, using _trace I see the return value is {EMPTY}.

When I use only the symbol ie:

staticvarset(Name(),lastvalue(longtriggerlevel));

and in backtester

varget(sig.symbol);

I can pass variables successfully (however it is always the last value
of the prices, since in the first pass/sweep it stores the final entry).

Finally, I would like to only store on buy or sigscalein rather than
all dates (to hopefully save time memory). Would I need to do anything
special for this?

Thanks!!

-mp





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/