Wednesday, May 20, 2009

Triple leveraged, inverse ETF for Financials: $FAZ

Ok, if you're not familiar, there's a stock\ETF, called Direxion Daily Finan. Bear 3X ($FAZ) that inversely tracks the Russell 1000 Financial Index (RIFIN.X) with triple leverage. 
So, that basically means if the RIFIN drops 1%, then FAZ goes up 3%... got it? 

Well, if you can grasp that idea than here's an interesting scenario that could make you a nice profit while your 401k is getting rocked. Keep in mind, risk\reward, since whenever there's a possibility to for high profit, you also have the same possibility for high loss. 
Anyway, here's a possible (yet simplified) scenario if the banks get slammed again. 
Lets say you buy FAZ @ $5 & RIFIN is @ $600 
-Doomsday 1: RIFIN -10%, closes at $540 & FAZ +30% @ $6.5 
-Doomsday 2: RIFIN -10%, closes at $486 & FAZ +30% @ $8.5 
-Doomsday 3: RIFIN -10%, closes at $437 & FAZ +30% @ $11 
-Doomsday 4: RIFIN -10%, closes at $393 & FAZ +30% @ $14 
-Doomsday 5: RIFIN -10%, closes at $354 & FAZ +30% @ $18 

So, RIFIN is ONLY down 37% & FAZ is up 260% for the week.

The reason this looks interesting to me, is that after day 1 of the crash, you've only missed a relatively small percent of the upside and if you get in on day 2, you still would of had a chance to be up 200% by end of week. This ETF can also be used as a "Cover" if you happen to own a few bank stocks during a downturn.

Warning: This ETF is ONLY for day\swing trading, NOT for buy and hold investing. Leveraged ETFs have a decay effect over long term, so I never hold $FAZ for more than a few days\weeks and always lock in profits by using a tight stop-loss.

Good luck trading.

Thursday, May 7, 2009

C# How To: Cascading dropdowns on a Formview for Country\Region selection

This is something most ASP.Net apps deal with regularly, but I couldn't find one solid solution on the interwebs. I needed a user to select a country and then have the "Region" dropdown be populated with the expected list of regions (states, provinces, etc)
I hope this helps. If not, at least I'll remember how it's done.

FYI, I've intentionally left out some details around data access since I am using ObjectDataSources and you can handle data access however u need. I also assume that you have a simple FormView control working that can update a record in your database.

Steps:
1: Make sure 'EnableViewState=true' is on your ASPX page or Masterpage.
2: Make sure you have a field like Country and Region in the DataTable you are editing and make sure you can update these values through an objectdatasource, if you want this example to work.

3: Create an objectdatasource (ie. odsCountries) that returns a list of Countries and bind to ddlCountry.

<asp:ObjectDataSource ID="odsCountries" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetCountries" TypeName="BLL">
</asp:ObjectDataSource>

4: Create an objectdatasource (ie. odsRegions) that returns a list of Regions with a Country parameter and bind to ddlCountry.

<asp:ObjectDataSource ID="odsRegions" runat="server" OldValuesParameterFormatString="original_{0}" SelectMethod="GetRegions" TypeName="BLL">
<SelectParameters>
<asp:ControlParameter ControlID="editForm$ddlCountry" Name="Country"/>
</SelectParameters>
</asp:ObjectDataSource>


5: Add a Country dropdownlist to the Formview's edit template (ie. ddlCountry)

<asp:DropDownList ID="ddlCountry" runat="server" SelectedValue='<%# Bind("COUNTRY") %>' DataSourceID="odsCountries"
OnDataBound="ddlCountry_DataBound" DataTextField="Country" DataValueField="Country" AutoPostBack="True"></asp:DropDownList>


6: Add a Region dropdownlist to the Formview's edit template (ie. ddlRegion)

<asp:DropDownList ID="ddlRegion" DataSourceID="odsRegions" runat="server" AutoPostBack="True"
DataTextField="REGION" OnDataBound="ddlState_DataBound"/>


7: Create 2 DataBound EventHandlers for each DropDownlist

protected void ddlCountry_DataBound(object sender, EventArgs e)
{
DropDownList ddlCountry = (DropDownList)sender;
ListItem li = new ListItem("Choose a Country", "");
ddlCountry.Items.Insert(0, li);

FormView editForm = (FormView)ddlCountry.NamingContainer;
if (editForm.DataItem != null)
{
string strCountry = ((DataRowView)editForm.DataItem)["COUNTRY"].ToString();
ddlCountry.ClearSelection();
ListItem li2 = ddlCountry.Items.FindByValue(strCountry);
if (li2 != null) li2.Selected = true;
}
}

protected void ddlRegion_DataBound(object sender, EventArgs e)
{
DropDownList ddlRegion = (DropDownList)sender;
ListItem li = new ListItem("Choose a Region", "");
ddlRegion.Items.Insert(0, li);

FormView editForm = (FormView)ddlRegion.NamingContainer;
if (editForm.DataItem != null)
{
string strRegion = ((DataRowView)editForm.DataItem)["REGION"].ToString();
ddlRegion.ClearSelection();

ListItem li2 = ddlRegion.Items.FindByValue(strRegion);
if (li2 != null) li2.Selected = true;
}

}


8: Don't forget to add this to your Update\Insert parameters on the Objectdatasource for your formview. This is needed to properly find the Region ddl within the Formview

<asp:ControlParameter ControlID="editForm$ddlRegion" Name="Region" />