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

[amibroker] Re: Help with PositionScore


  • Date: Wed, 10 Mar 2010 16:34:49 -0000
  • From: "j0etr4der" <j0etr4der@xxxxxxxxx>
  • Subject: [amibroker] Re: Help with PositionScore

PureBytes Links

Trading Reference Links

PositionScore uses the current bar by default. Which is looking forward.  So...

PositionScore = Ref( ROC( Close, 40 ), - 1 );

You can confirm this for yourself by looking at the individual trades using the Detail Log report.

Don't think this answers your question, but using the Detail Log report might help.

--- In amibroker@xxxxxxxxxxxxxxx, "nunopires2001" <nunopires2001@xxx> wrote:
>
> Imagine this simple system:
> 
> Rule: Stock's close is above MA(50)
> If rule is fulfilled, send a limit order, 2% below yesterday close.
> 
> AFL Code:
> /*******************************************************************
> //Stock above MA
> Rule1=Ref(Close,-1)>MA(Ref(Close,-1),50);
> //Stock drops 2%
> Rule2=Iif(Low<0.98*Ref(Close,-1),1,0);
> 
> Buy=Iif(Rule1==1 AND Rule2==1,1,0);
> //Buyprice can be 2% below yesterday close, or even  better.
> BuyPrice=Iif(Open<0.98*Ref(Close,-1),Open,0.98*Ref(Close,-1));
> 
> SetOption("MaxOpenPositions", 5 ); // no more than 5 positions
> PositionScore=ROC(C,40);
> /*******************************************************************
> 
> 
> As you can imagine, this simple system will trigger lots of buy signals every day. Without PositionScoring, I guess Amibroker choose the stocks by alphabetically order? 
> 
> So, to solve this question, i thought in a simple ranking filter.
> Lets say: PositionScore=ROC(C,40);
> 
> 
> But, now there is my problem. If i apply PositionScore to the system above, system will be forward-looking.
> The rank is applied to every stocks dropping 3%, and the ones with better rank are chosen.
> 
> In real life, if I already have 4 open positions, only the stock with highest rank should be considered.
> 
> Anyone can help?
> 
> Probably my explanation wasn't clear, this isn't easy to explain. Ask me any questions, if that was the case.
> 
> Many thanks!
>




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

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

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

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