Re: [amibroker] Re: Need help with PositionSize using an optimization for ATR

 

Steve:  What it means is that the highest and lowest ATR is the same over the lookback period. 
Change the second to last line of code to the following:
position_size = MaxEquity - (((var1 - var3)*(MaxEquity - MinEquity))/(.000000001 + var2 - var3));

If you still have problems then use the code and create a separate indicator.  Use the indicator with some different securities i.e. DIA or SPY and make sure the code is working correctly.  Then try the indicator with the security you are having issues with.

On 2/22/2016 6:01 PM, steve@optimusadvisory.com [amibroker] wrote:
 

Alan:  Thanks so much for all your trouble.


I inserted that code at the end of my code where the usual position size code is located.  I received a Warning 505: Division by zero (for the 2nd to last line of code).  Divisor array at [10] is equal to zero.

__._,_.___

Posted by: Alan <alan@thenorthams.us>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (10)
**** 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/


.

__,_._,___


EmoticonEmoticon