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

[amibroker] Re: Optimizing



PureBytes Links

Trading Reference Links

Thank, this variant works fine.

Per1 = optimize( "MA1", 10, 5, 20, 1 );
Per2 = Per1 + optimize( "MA2", 10, 1, 20, 1 );


Im testing forex right now, so i need to adjust my stoploss to 
currency pairs. The range is 100-150 pips. I wrote formula based on 
close value, but as i see, values in optimize function are not 
arrays and next code is not working

pair = iif(c>100,100,10000);// If close price more than 100, 
probably its USDJPY pair, so i need to divide by 100. Others pairs 
divided by 10000.

stoploss = optimize("stoploss",100/pair,100/pair,150/pair,1/pair);

Any ideas?

--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> I will senmd another answer with alternatives
> 
> Per1 = optimize( "MA1", 10, 5, 20, 1 );
> Per2 = Per1 * optimize( "MA2", 2, 1, 5, 1 );
> 
> Per1 = optimize( "MA1", 10, 5, 20, 1 );
> Per2 = optimize( "MA2", 30, 21, 40, 1 );
> 
> On 6/29/05, Graham <kavemanperth@xxxx> wrote:
> > I think I understand your problem, you did not say it was the MA
> > periods you were referring to, not the MA values
> > 
> > If you want one MA period larger than the other then set the 
optimise
> > boundaries for each MA accordingly.
> > 
> > here is an example to ensure one MA period is larger than the 
other
> > 
> > Per1 = optimize( "MA1", 10, 5, 20, 1 );
> > Per2 = Per1 + optimize( "MA2", 10, 1, 20, 1 );
> > 
> > 
> > 
> > 
> > On 6/28/05, andreyoffline <offline@xxxx> wrote:
> > > It does. But when firstma bigger than secondma, condition is 
never
> > > true. So why to calculate, if from beginning you know that no 
trades
> > > will be generated?
> > >
> > > Look at screenshot
> > >
> > > 
http://images10.fotki.com/v197/photos/4/474236/2175564/results28_06_2
> > > 00515_19_49-vi.jpg
> > >
> > > -- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> 
wrote:
> > > > If it does not calculate it then how does it know to exclude 
it?
> > > >
> > > > On 6/28/05, andreyoffline <offline@xxxx> wrote:
> > > > > If i add "firstma<secondma" to my buy condition, i get 
many blank
> > > > > results, but its still take time to calculate.
> > > > >
> > > > > Buy = iif(firstma<secondma,MA(C,firstma)>MA(C,secondma),0);
> > > > >
> > > > > How to set optimizing values so tester will not even try to
> > > > > calculate when firstma bigger than secondma?
> > > > >
> > > > >
> > > > > --- In amibroker@xxxxxxxxxxxxxxx, Graham 
<kavemanperth@xxxx>
> > > wrote:
> > > > > > just add the conditions that you require to your Buy 
statement
> > > > > >
> > > > > > On 6/28/05, andreyoffline <offline@xxxx> wrote:
> > > > > > > Lets say I have system based on Moving Avarage 
crosses. I
> > > want to
> > > > > > > optimize periods lengths, but i dont want to test buy 
signals
> > > > > when
> > > > > > > slow MA above fast MA.
> > > > > > >
> > > > > > > firstma = Optimize("First MA", 10, 3, 50 ,1);
> > > > > > > secondma = Optimize("Second MA", 30, 9, 150 ,1);
> > > > > > >
> > > > > > > How can i resolve this problem?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > 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
> > > > > > http://e-wire.net.au/~eb_kavan/
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > 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
> > > > http://e-wire.net.au/~eb_kavan/
> > >
> > >
> > >
> > >
> > >
> > > 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
> > http://e-wire.net.au/~eb_kavan/
> > 
> 
> 
> -- 
> Cheers
> Graham
> http://e-wire.net.au/~eb_kavan/




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/