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

Re: [amibroker] Re: Summing volume



PureBytes Links

Trading Reference Links

Almost everything is an array. You are simply evaluating every bar (every
day) at the same time. Each bar gets a value that you may consider a
boolean. Itıs just an array of boolean values, 1 for each bar or day in your
case. This is actually what you want. 1 boolean value for each day which is
held in an array of all boolean values for all days.

If you have a loop you access each bar with a subscript[i]
-- 
Terry


From: "virtuouz_pagan" <dimension@xxxxxxxxxxxxx>
Reply-To: amibroker@xxxxxxxxxxxxxxx
Date: Thu, 21 Oct 2004 21:43:04 -0000
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Summing volume


i am not getting this.
isn't the code below a boolean evaluation( 'AND' should evaluate to
a boolean)?  how can this be an array?
bBuy =       ( V > ( stockFloat ) ) AND
             ( fCumVol < stockFloat ) AND
             ( C > O ) ;

If the above evaluated to an array, what if i actually need bBuy to
evaluate to a boolean for a more complex script? how can that be
done?

thanks much

--- In amibroker@xxxxxxxxxxxxxxx, Terry <MagicTH@xxxx> wrote:
> In order of your code, here's a few comments:
> 
> Your bBuy statement requires todayıs volume to be greater than the
last 5
> days Volume added together. Is that what you want?
> 
> Your buy statement can be simply:
> 
>    Buy = bBuy; //which sets Buy = True when bBuy is True
> 
> AddColumn statements should not be inside a conditional. I group
mine at the
> end of the code. If you only want to see them on certain bars the
use Filter
> as in:
> 
>    Filter = bBuy;
>    AddColumn(....
>    AddColumn(....
> -- 
> Terry
> 
> 
> From: "virtuouz_pagan" <dimension@xxxx>
> Reply-To: amibroker@xxxxxxxxxxxxxxx
> Date: Thu, 21 Oct 2004 04:29:27 -0000
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Summing volume
> 
> 
> thanks much.  any ideas on why i get a syntax error with the code
> below? If i include the code within the "IF" clause with out the
> actualy "IF" block, it works fine. but with the "IF" clause there i
> get the following error:
> "Line 15, Column 2:
>          AddColumn(fCumVol,"fCumVol", 1.0);
> 
>          AddColumn(bBuy,"Buy", 1.0);
> 
>       Buy = True;
> 
> }
> -^
> 
> Error 3.
> Condition in IF, WHILE, FOR statements
> has to be Numeric or Boolean type.
> You can not use array here,
> please use [] (array subscript operator)
> to access array elements"
> 
> Here is the code:
> ---------------------------------------------------------
> stockFloat = 19100000;
> 
> fCumVol = Ref( fCumVol = Sum( V, 5 ), -1);
> 
> bBuy =       ( V > ( stockFloat ) ) AND
>             ( fCumVol < stockFloat ) AND
>             ( C > O ) ;
> 
> if ( bBuy )
> {
>       Filter = 1;
>          AddColumn(fCumVol,"fCumVol", 1.0);
>          AddColumn(bBuy,"Buy", 1.0);
>       Buy = True;
> }
> 
> --- In amibroker@xxxxxxxxxxxxxxx, Terry <MagicTH@xxxx> wrote:
> > Try this:
> > CumVol = Sum( ref(V,-1), 5 );
> > 
> > An Explore is like a back test in that you get the same results
> without the
> > Report. You can add as many AddColumn statements as you want to
> see things
> > like your Buy/Sell/Short/Cover signals, Volume, Close, any
> variable you have
> > in your code.
> > -- 
> > Terry
> > 
> > 
> > From: "virtuouz_pagan" <dimension@xxxx>
> > Reply-To: amibroker@xxxxxxxxxxxxxxx
> > Date: Thu, 21 Oct 2004 03:34:17 -0000
> > To: amibroker@xxxxxxxxxxxxxxx
> > Subject: [amibroker] Re: Summing volume
> > 
> > 
> > actually, it's almost what i needed.
> > I am using the BackTest function and would like to see the
fCumVol
> > value at each signal. I was trying to use the "printf" function,
> but
> > do not see anything printed in the Interpretation or NotePad
> window.
> > What would be better however, is if i could add a column to the
> > backtest grid/table, similar to what you suggested for the
Explore
> > function.  Is that possible?
> > 
> > sorry for the barrage of questions...
> >  
> > --- In amibroker@xxxxxxxxxxxxxxx, Terry <MagicTH@xxxx> wrote:
> > > Correct
> > > 
> > > Filter = 1;
> > > AddColumn(fCumVol,"fCumVol",1.0);
> > > 
> > > Then click Explore in AA
> > > -- 
> > > Terry
> > > 
> > > 
> > > From: "virtuouz_pagan" <dimension@xxxx>
> > > Reply-To: amibroker@xxxxxxxxxxxxxxx
> > > Date: Thu, 21 Oct 2004 03:08:05 -0000
> > > To: amibroker@xxxxxxxxxxxxxxx
> > > Subject: [amibroker] Summing volume
> > > 
> > > 
> > > On processing the current bar, i would like to determine the
> > > cumulative volume of the last 5 bars (including the current).
> > > Would the folliwng do this?
> > > 
> > >   fCumVol = Sum( V, 5 );
> > > 
> > > Second question.  If i wanted to print out debug statements to
> see
> > > the above value as each bar is processed, how can i do that?
> > > 
> > > thank you.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > Check AmiBroker web page at:
> > > http://www.amibroker.com/
> > > 
> > > Check group FAQ at:
> > > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > > 
> > > 
> > > Yahoo! Groups Sponsor
> > >  
> > >  ADVERTISEMENT
> > >  
> > 
> 
<http://us.ard.yahoo.com/SIG=129a4dsog/M=295196.4901138.6071305.30011
> > 76/D=g
> > > 
> > 
> 
roups/S=1705632198:HM/EXP=1098414491/A=2128215/R=0/SIG=10se96mf6/*htt
> > p://com
> > > panion.yahoo.com>
> > > 
> > > 
> > > Yahoo! Groups Links
> > > * To visit your group on the web, go to:
> > > * http://groups.yahoo.com/group/amibroker/
> > > *  
> > > * To unsubscribe from this group, send an email to:
> > > * amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > > <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?
> subject=Unsubscribe>
> > > *  
> > > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> > Service
> > > <http://docs.yahoo.com/info/terms/> .
> > 
> > 
> > 
> > 
> > 
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> > 
> > Check group FAQ at:
> > http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > 
> > 
> > Yahoo! Groups Sponsor
> >  
> >  ADVERTISEMENT
> >  
> 
<http://us.ard.yahoo.com/SIG=129jnevc3/M=315388.5500238.6578046.30011
> 76/D=g
> > 
> 
roups/S=1705632198:HM/EXP=1098416071/A=2372354/R=0/SIG=12id813k2/*htt
> ps://ww
> > w.orchardbank.com/hcs/hcsapplication?
> pf=PLApply&media=EMYHNL40F21004SS>
> > 
> > 
> > Yahoo! Groups Links
> > * To visit your group on the web, go to:
> > * http://groups.yahoo.com/group/amibroker/
> > *  
> > * To unsubscribe from this group, send an email to:
> > * amibroker-unsubscribe@xxxxxxxxxxxxxxx
> > <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?
subject=Unsubscribe>
> > *  
> > * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
> Service
> > <http://docs.yahoo.com/info/terms/> .
> 
> 
> 
> 
> 
> Check AmiBroker web page at:
> http://www.amibroker.com/
> 
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> 
> 
> Yahoo! Groups Sponsor
>  
>  ADVERTISEMENT
>  
<http://us.ard.yahoo.com/SIG=1293vk4r0/M=294855.5468653.6549235.30011
76/D=g
> 
roups/S=1705632198:HM/EXP=1098419387/A=2376776/R=0/SIG=11ldm1jvc/*htt
p://pro
> motions.yahoo.com/ydomains2004/index.html>
> 
> 
> Yahoo! Groups Links
> * To visit your group on the web, go to:
> * http://groups.yahoo.com/group/amibroker/
> *  
> * To unsubscribe from this group, send an email to:
> * amibroker-unsubscribe@xxxxxxxxxxxxxxx
> <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
> *  
> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service
> <http://docs.yahoo.com/info/terms/> .





Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html


Yahoo! Groups Sponsor
 
 ADVERTISEMENT
 <http://us.ard.yahoo.com/SIG=1296en40b/M=294855.5468653.6549235.3001176/D=g
roups/S=1705632198:HM/EXP=1098481406/A=2376776/R=0/SIG=11ldm1jvc/*http://pro
motions.yahoo.com/ydomains2004/index.html>


Yahoo! Groups Links
* To visit your group on the web, go to:
* http://groups.yahoo.com/group/amibroker/
*  
* To unsubscribe from this group, send an email to:
* amibroker-unsubscribe@xxxxxxxxxxxxxxx
<mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
*  
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> 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/