StockFetcher Forums · General Discussion · select by - backtesting<< >>Post Follow-up
WolfMan
7 posts
msg #117697
Ignore WolfMan
1/11/2014 8:04:08 AM

The below works when I filter - but when I try to backtest and select by column 5 decending - all I get are the highest priced stocks. Any ideas on the phrase I need to use in "select by" for it to work

/* 1 month weighted at 80%*/

set{1m, roc(21,1) * .80}

/* 2 months weighted at 20%*/

set{2m, roc(42,1) * .20}

/* add them together */

set{z, 1m + 2m}

/* present column value of z */

add column z

/* present line chart of z */

draw z

sort column 5 descending


mahkoh
1,065 posts
msg #117705
Ignore mahkoh
1/11/2014 7:50:42 PM

Did you by any chance just put in "sort column 5"? Try putting in the whole filter.

WolfMan
7 posts
msg #117711
Ignore WolfMan
1/12/2014 8:35:30 AM

I just tried both - did not work. I'm not sure what I need to do when backtesting to sort the securities as it works when filtering. The output is always the top trading stocks based on price when backtesting.

mahkoh
1,065 posts
msg #117712
Ignore mahkoh
1/12/2014 9:33:35 AM

Maybe specify the column by its name? 'Sort column z descending'

Kevin_in_GA
4,599 posts
msg #117714
Ignore Kevin_in_GA
1/12/2014 10:19:44 AM

Put in the whole filter - really just the lines that build the variable you are sorting on, then add "sort by z descending". SF backtesting doesn't care about anything you put in a column, draw on a graph, or that is not needed to do the sort.

WolfMan
7 posts
msg #117723
Ignore WolfMan
1/13/2014 8:34:55 AM

Thanks Kevin. I put the above in the filter and the below in the select by box

set{1m, roc(21,1) * .80}
set{2m, roc(42,1) * .20}
set{z, 1m + 2m}
Sort by z descending

I am still getting results based on the top priced stocks. I am trying to select the top 4 and set the parameters to only have 4 open trades. But I'm still getting the to prices stocks not sorted by "z".

WolfMan
7 posts
msg #117724
Ignore WolfMan
1/13/2014 8:50:33 AM

Got it!! Thanks. I just changed "sort" to "select"and it worked.

Kevin_in_GA
4,599 posts
msg #117726
Ignore Kevin_in_GA
1/13/2014 2:12:26 PM

That is right - select, not sort. Glad it is working for you.

StockFetcher Forums · General Discussion · select by - backtesting<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.