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

Re: [amibroker] Re: Changing RoundLotSize on the fly



PureBytes Links

Trading Reference Links

Fred,
wrong structure for IIF
see my other reply

On 9/1/05, Graham <kavemanperth@xxxxxxxxx> wrote:
> the boolean bit, teach me again to actually test what i type, you need
> to use bar identifier [i] for variables, plus as I diod say i was not
> certain if the for loop was required.
> 
> 
> 
> using IIF is different mnethod than using IF
> 
> Roundlotsize = IIF( e<10000, 100,
> IIf( e>=10000 AND e<100000, 500,
> IIf( e>=100000 AND e<1000000, 1000,
> IIf( e>=1000000 AND e<10000000, 10000,
> IIf( e>=10000000 AND e<100000000, 50000,
> 100000 )))));
> 
> 
> 
> 
> On 9/1/05, eric paradis <thechemistrybetweenus@xxxxxxxxx> wrote:
> > Fred, if I do this I still get a syntax error.
> >
> >  e =Equity(1);
> > IIf( e<10000) RoundLotSize=100;
> > IIf( e>=10000 AND e<100000) RoundLotSize=500 ;
> > IIf( e>=100000 AND e<1000000) RoundLotSize=1000 ;
> > IIf( e>=1000000 AND e<10000000) RoundLotSize=10000 ;
> > IIf( e>=10000000 AND e<100000000) RoundLotSize=50000 ;
> > IIf( e>=100000000) RoundLotSize=100000;
> >
> > I also tried to attempt a typecast, separately on a
> > different backtest with no luck.
> >
> >  //e= 0;
> >  //e[0]=0;
> >  //e[0] = Equity(1);
> >
> > no luck here, as it says its not possible to have an
> > element on the rightside of the array.
> >
> > --- Fred <ftonetti@xxxxxxxxxxxxx> wrote:
> >
> > > IIF ... but you'll have to change the statement
> > > structure.
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, eric paradis
> > > <thechemistrybetweenus@xxxx> wrote:
> > > > Graham thanks. I get an error message for all the
> > > > lines of code saying:
> > > >
> > > > Error 6. Condition in IF, WHILE, FOR statements
> > > has to
> > > > be numeric or boolean type. You can not use an
> > > array
> > > > here. Please use [ ] ( array subscript operator)
> > > to
> > > > access array.
> > > >
> > > > Any ideas on how to solve this?
> > > >
> > > > Thanks
> > > >
> > > >
> > > >
> > > > --- Graham <kavemanperth@xxxx> wrote:
> > > >
> > > > > try using some If statements
> > > > > something like this for starters, don't know off
> > > > > hand if a for loop
> > > > > would be required
> > > > > e=equity(1);
> > > > > if( e<100000) roundlotsize=100;
> > > > > if( e>=100000 and e<1000000) roundlotsize=1000 ;
> > > > > if( e>=1000000) roundlotsize=10000;
> > > > >
> > > > > On 9/1/05, eric paradis
> > > > > <thechemistrybetweenus@xxxx> wrote:
> > > > > > Hi,
> > > > > >
> > > > > > Can anyone suggest how to code a rule for
> > > setting
> > > > > > RoundLotSize so that when the Equity reachs
> > > 100k,
> > > > > > RoundLotSize gets set to 1000 shares, when
> > > 1mil,
> > > > > > RoundLotSize get set to 10000 shares, and so
> > > on.
> > > > > >
> > > > > > Much appreciated.
> > > > > >
> > > > > > Eric
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > ____________________________________________________
> > > > > > Start your day with Yahoo! - make it your home
> > > > > page
> > > > > > http://www.yahoo.com/r/hs
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > > 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 other support material please check also:
> > > > > > http://www.amibroker.com/support.html
> > > > > >
> > > > > >
> > > > > > Yahoo! Groups Links
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Cheers
> > > > > Graham
> > > > > AB-Write >< Professional AFL Writing Service
> > > > > Yes, I write AFL code to your requirements
> > > > > http://e-wire.net.au/~eb_kavan/ab_write.htm
> > > > >
> > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam
> > > protection around
> > > > http://mail.yahoo.com
> > >
> > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> >
> > 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 other support material please check also:
> > http://www.amibroker.com/support.html
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> 
> 
> --
> Cheers
> Graham
> AB-Write >< Professional AFL Writing Service
> Yes, I write AFL code to your requirements
> http://e-wire.net.au/~eb_kavan/ab_write.htm
> 


-- 
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://e-wire.net.au/~eb_kavan/ab_write.htm


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Help Sudanese refugees rebuild their lives through GlobalGiving.
http://us.click.yahoo.com/hjNroD/EbOLAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

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