So why does this simple test of Actions always sort column 4 (a minus 
means descending), no matter scan, explore or backtest ???

Title = "TestActions";

/* actionScan = 3
actionExplore = 4
actionBacktest = 5 */

IIf( Status("action") == actionScan, SetSortColumns (-2),
        IIf( Status("action") == actionExplore, SetSortColumns (-3),
                IIf( Status("action") == actionBacktest, 
SetSortColumns (-4),Null)));

//RSI 70/30 Crossover ***Optimized***

pds=14;
pds=Optimize("pds",14,8,23,3);

Buy=Ref(RSI(pds),-1) < 30 AND RSI(pds) >= 30;
Sell=Ref(RSI(pds),-1) > 70 AND RSI(pds) <= 70;
Short=Ref(RSI(pds),-1) > 70 AND RSI(pds) <= 70;
Cover=Ref(RSI(pds),-1) < 30 AND RSI(pds) >= 30;

Filter=Buy OR Sell OR Short OR Cover;
Buy=ExRem(Buy,Sell); Sell=ExRem(Sell,Buy); Short=ExRem(Short,Cover); 
Cover=ExRem(Cover,Short);

AddColumn(Buy,"Buy");
AddColumn(Sell,"sell");
AddColumn(Short,"short");
AddColumn(Cover,"cover");

GraphXSpace = 5;

--- In [email protected], "tuzo_wilson" <[EMAIL PROTECTED]> 
wrote:
>
> --- In [email protected], "gmorlosky" <gmorlosky@> wrote:
> >
> > Where did you find or discover the information that varibale 
> > AAsetting is assigned "Status("action"). Is this deep code 
> > understanding or something us common folk should be able to 
lookup ?
> 
> It's in the user guide and online:
> 
> http://www.amibroker.com/guide/afl/afl_view.php?id=141
> 
> It can also be seen in many code examples.  e.g.
> http://www.amibroker.com/guide/a_custommetrics.html
> 
> There are actually 6 values with predefined constants you can use in
> AFL to make your code more readable:
> 
> actionIndicator = 1
> actionCommentary = 2
> actionScan = 3
> actionExplore = 4
> actionBacktest = 5
> actionPortfolio = 6 
> 
> actionPortfolio is used when running a custom backtest.
> 
> 
> Tuzo
>


Reply via email to