<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to find the optimal WIN-LOSE portfolio?! in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-find-the-optimal-WIN-LOSE-portfolio/m-p/802594#M3654</link>
    <description>&lt;PRE&gt;Say here are 10 Winner and 10 Loser Portfolio(with 20 daily performances, see the data below). &lt;BR /&gt;How to find the optimal WIN-LOSE portfolio pair with the maximum RET/stdev [ret=ret_win-ret_lose]?! &lt;BR /&gt;Anyway to find the optimal with ret (historical ret as expected ret) and correlation matrix, &lt;BR /&gt;rather than go through emulation?! &lt;CODE class=" language-sas"&gt;

data _port_win_expt_ret;
do i=1 to 10;
do tradingday=1 to 20;
	ret=100+2*ranuni(i);
	output;
end;
end;
run;quit;

data _port_lose_expt_ret;
do i=1 to 10;
do tradingday=1 to 20;
	ret=100-1.5*ranuni(i);
	output;
end;
end;
run;quit;

proc sort data=_port_win_expt_ret;by tradingday i; run;quit;
proc transpose data=_port_win_expt_ret out=_port_win_expt_ret_t(drop=_NAME_) prefix=ret_W_;
by tradingday;
var ret;
id i;
run;quit;

proc sort data=_port_lose_expt_ret;by tradingday i; run;quit;
proc transpose data=_port_lose_expt_ret out=_port_lose_expt_ret_t(drop=_NAME_) prefix=ret_L_;
by tradingday;
var ret;
id i;
run;quit;

proc sql;
create table _port_WL_ as 
select 	a.*, 
		b.*
from _port_win_expt_ret_t as a
left join _port_lose_expt_ret_t as b
on a.tradingday=b.tradingday
order by a.tradingday;
quit;

proc corr data= _port_WL_ out= _port_WL_corr;
run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 17 Mar 2022 09:25:51 GMT</pubDate>
    <dc:creator>hellohere</dc:creator>
    <dc:date>2022-03-17T09:25:51Z</dc:date>
    <item>
      <title>How to find the optimal WIN-LOSE portfolio?!</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/How-to-find-the-optimal-WIN-LOSE-portfolio/m-p/802594#M3654</link>
      <description>&lt;PRE&gt;Say here are 10 Winner and 10 Loser Portfolio(with 20 daily performances, see the data below). &lt;BR /&gt;How to find the optimal WIN-LOSE portfolio pair with the maximum RET/stdev [ret=ret_win-ret_lose]?! &lt;BR /&gt;Anyway to find the optimal with ret (historical ret as expected ret) and correlation matrix, &lt;BR /&gt;rather than go through emulation?! &lt;CODE class=" language-sas"&gt;

data _port_win_expt_ret;
do i=1 to 10;
do tradingday=1 to 20;
	ret=100+2*ranuni(i);
	output;
end;
end;
run;quit;

data _port_lose_expt_ret;
do i=1 to 10;
do tradingday=1 to 20;
	ret=100-1.5*ranuni(i);
	output;
end;
end;
run;quit;

proc sort data=_port_win_expt_ret;by tradingday i; run;quit;
proc transpose data=_port_win_expt_ret out=_port_win_expt_ret_t(drop=_NAME_) prefix=ret_W_;
by tradingday;
var ret;
id i;
run;quit;

proc sort data=_port_lose_expt_ret;by tradingday i; run;quit;
proc transpose data=_port_lose_expt_ret out=_port_lose_expt_ret_t(drop=_NAME_) prefix=ret_L_;
by tradingday;
var ret;
id i;
run;quit;

proc sql;
create table _port_WL_ as 
select 	a.*, 
		b.*
from _port_win_expt_ret_t as a
left join _port_lose_expt_ret_t as b
on a.tradingday=b.tradingday
order by a.tradingday;
quit;

proc corr data= _port_WL_ out= _port_WL_corr;
run;quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Mar 2022 09:25:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/How-to-find-the-optimal-WIN-LOSE-portfolio/m-p/802594#M3654</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-03-17T09:25:51Z</dc:date>
    </item>
  </channel>
</rss>

