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

[amibroker] Re: Synchronization problem between panes using Static array variables



PureBytes Links

Trading Reference Links

I assume when you switch between symbols you want to preserve the data relative for each symbol. If so the names must be unique. Have you tried using a prefix to differentiate the symbols when you switch them? Try this and see if it works when you change tickers.
 
StaticVarSet(name() + "varccibuysignals", Buy1);   

If you also switch time frames add the interval, 

VarPfx = name() + numtostr(interval, 1, false);
StaticVarSet(VarPfx + "varccibuysignals", Buy1);

This will give your static vars a unique name between tickers and times.

Barry

--- In amibroker@xxxxxxxxxxxxxxx, Thomas Ludwig <Thomas.Ludwig@xxx> wrote:
>
> Hello,
> 
> I've implemented this new feature in AB in a certain layout. I'm using a 
> variable CCI in one pane and plot the signals in the other. 
> 
> So in the one pane I defined:
> 
> [...]
> StaticVarSet("varccibuysignals", Buy1);
> StaticVarSet("varccisellsignals", Sell1);
> StaticVarSet("varcci", varcci(Avg,n));
> 
> and in the other one:
> [...]
> varccibuysig = StaticVarGet("varccibuysignals");
> varccisellsig = StaticVarGet("varccisellsignals");
> varcci = StaticVarGet("varcci");
> PlotShapes(varcciBuysig*shapeUpTriangle,colorGreen,0,L,-25);
> PlotShapes(varcciSellsig*shapeDownTriangle,colorRed,0,H,-25);
> Varccicolor=IIf(Varcci>0,colorGreen,colorRed);
> Plot(2,"",Varccicolor,styleArea|styleOwnScale,0,100,0);
> Plot( 3,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 100 );
> 
> This works very well - with one exception: If I scroll through my symbols tree 
> to plot other symbols with this layout, the signals in the second pane are not 
> properly updated/synchronized. Only if I scroll through dates in the scroll 
> bar at the bottom, the signals are re-calculated. I guess it's a caching 
> problem. How can programmatically avoid it? I have tried using 
> RequestTimedRefresh( 1 ); and that works. But since I'm not a real-time trader 
> (only EOD) I wonder if that makes much sense and if there is a simpler 
> solution.
> 
> I have a probably similar problem (that has nothing to do with static array 
> variables) in another layout. In one of its sheets I'm calculating several 
> market indicators (zscores for put/call-ratio, VIX, VXN, etc.) using the 
> Foreign() function. If I click this sheet for the first time not all of these 
> indicators are properly displayed. Only after scrolling through dates or 
> switching to another sheet and switching back they are displayed as they 
> should.
> 
> Any help would be appreciated.
> 
> Greetings,
> 
> Thomas
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/