Re: [amibroker] Simulate several Pending orders

 

Hi,
that was just a code snippet that focuses on a specific problem you cannot just plug stuff in an run a backtest.

On 3/17/2016 4:41 AM, cam_111000@yahoo.com.au [amibroker] wrote:
 

Hi Aron, thanks for uploading the code for public access.  I'd like to do something similar to the OP, but somehow I can't get it to backtest on equities.
I made a few very basic changes, but I'm not skilled in coding.  I wonder if you could suggest what I need to change please?


OptimizerSetEngine("cmae"); 
Sell = short = Cover = pos = 0;
Buy = 1;
TickSize = Optimize("1",1,1,100,1);
increment = Optimize("2",.01,.01,.99,.01) * TickSize ;
orders = 5;
PositionSize  = 10000;
Sell = C>0;

for( i = 0 ; i < BarCount ; i ++ )
{
    if( pos )
    {
    
        count = 0;
        for( n = 1 ; n <= orders ; n ++ )
        {
            if( order[n] )
            {
                if( High [i] > order [n] )
                {
                    Buy [i] = sigScaleIn;
                    count ++;
                    order[n] = 0; // executed
                }
            }
        }

        PositionSize [i] = count * 10000;
    }
    else
    {
        if( Buy [i] )
        {
            order = Null ;

            for( n = 1 ; n <= orders  ; n ++ )
            {
                order [n] = Close [i] + n * increment;
            }

            pos  = True;
        }
    }
}


__._,_.___

Posted by: Aron Pipa <aron@myafl.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (0)

Check out the automatic photo album with 2 photo(s) from this topic.
ehgdcggj.png eeffiibe.png

Save time and get your email on the go with the Yahoo Mail App
Get the beautifully designed, lighting fast, and easy-to-use, Yahoo Mail app today. 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