Re: [amibroker] Help fixing ReqLotSize Setting

 

Hello,

What is your RoundLotSize setting?

From the error it looks like it is 1.

The error message is quite clear
you are trying to buy ONE share (reqLotSize = 1) which price is $645000
but requested position size is 0.0454545% of equity which is  $90909.
Since requested size is LESS than the price of ONE share, you can't buy it
probably because you have used roundlotsize = 1


Best regards,
Tomasz Janeczko
amibroker.com

On 2016-06-27 01:21, scwalker1986@gmail.com [amibroker] wrote:

I am striving to build some simple testing of the Norgate premium historical indexes (PDU), and I am getting execution problems due to ReqLotSize.   This is not using futures, and my intention is to be able to purchase partial shares, if needed.  I have changed everything I can find that should allow this, but nothing seems to work. Due to using adjusted data, some of the individual share prices can become very high.

Specifically, I am getting the error symbol "not entered because of insufficient funds or wrong positionsize/value";  see attached picture.

This particular code intends to buy all shares in the index, dividing the money equally, but I have also tried it using fix $ amounts, as well as with rotation systems, and I am getting similar problems.   I have pasted the code and settings; any suggestions is very much appreciated.


Scott

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


_SECTION_BEGIN("Buy/Sell Setup");


SetBacktestMode( backtestRegular); // 


SetOption("InterestRate", 0 );

SetOption("InitialEquity", 200000000 );

SetOption("ActivateStopsImmediately", False );

SetOption("AllowPositionShrinking", True );

SetOption("FuturesMode", False );

SetOption("InterestRate", 0 );

SetOption("MinPosValue", .001 );

SetOption("MinShares", .001 );

SetOption("PriceBoundChecking", True );

SetOption("ReverseSignalForcesExit", True ); 

SetOption("UsePrevBarEquityForPosSizing", True );

SetOption("HoldMinBars", 0 );

HMindays  =Param("HMindays", 0,0,21,1);  // hold min # of days - trading Fridays, so now 0

SetOption("HoldMinDays", HMindays );


RModeN = Param("0 TL,1 DL,2 Sum,3 0", 0,0,3,1);   // 0 - trade list; 1 - detailed log;2 - summary;3 - no output (custom only)

SetOption("PortfolioReportMode", RModeN );


SetOption("EveryBarNullCheck", False );

SetOption("HoldMinBars", 0 );

SetOption("EarlyExitFee", 0 );

SetOption("HoldMinDays", 0 );

SetOption("EarlyExitDays", 0 );

SetOption("DisableRuinStop", False );

SetOption("GenerateReport", 1 );  //full report

SetOption("ExtraColumnsLocation", 1 ); // working


SetOption( "CommissionMode", 3 ); /* 3 set commissions $ per share; 1=% of trade */

comamt  =Param("comamt shr", .01,.0,.1,.01);  // sw more conservative ver

SetOption( "CommissionAmount", comamt ); /* per share  + SLIPPAGE */


MARGX = Param("marginx", 100, 10, 100, 10);  //40 means use up to 60% margin, 100 mean no margin

SetOption ("AccountMargin", MARGX );   

MaxPositions = CondOptimize("max pos", 2200,1,2200,2); //Should be the same as the number of stocks being run in order to pass to the backtester 

SetOption("MaxOpenLong", MaxPositions );

SetOption("MaxOpenPositions", MaxPositions);

PositionSize = (-100 / (MaxPositions));

//SetPositionSize( 1, 4 ) ;  // 4= spsShares (=4) - size expressed in shares/contracts (size must be > 0 ) 

//SetPositionSize( 30000, 1 ) ;  // 1= dollar value of size 

SetTradeDelays( 0, 0, 0, 0 );

BuyPrice = CoverPrice = close;

SellPrice = ShortPrice = close;


_SECTION_END();


OnLastTwoBarsOfDelistedSecurity = !IsNull(GetFnData("DelistingDate")) AND (BarIndex() >= (LastValue(BarIndex()) -1) OR DateTime() >= GetFnData("DelistingDate") );



//----------------------------------------------------- Buy Sell  ---------------------------*

 

Buy = IsIndexConstituent("$RUT") AND NOT OnLastTwoBarsOfDelistedSecurity; 


Sell = !IsIndexConstituent("$RUT") AND Ref(IsIndexConstituent("$RUT") , -1) ; 





__._,_.___

Posted by: Tomasz Janeczko <groups@amibroker.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Check out the automatic photo album with 1 photo(s) from this topic.
sys settings reqlotsize.PNG

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.

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