Tuesday, April 13, 2010

Todays Project - DMI Ratio Indicator

Todays project is converting the DMI Ratio indicator from Tradestation easy language to ASCIL.

Update - 13:06

Ok finished the indicator.  I had the usual problems with the variable definitions.  Worked through them again.  Today I "learned" how to set primary and secondary color for a plot. I also learned how to use the autocoloring.

sc.Subgraph[2].Name = "DMI Ratio";


sc.Subgraph[2].DrawStyle = DRAWSTYLE_BAR;

sc.Subgraph[2].PrimaryColor = RGB(0,255,0);

sc.Subgraph[2].SecondaryColor = RGB(255,128,128);

sc.Subgraph[2].SecondaryColorUsed = 1;

sc.Subgraph[2].LineWidth = 3;

sc.Subgraph[2].AutoColoring = AUTOCOLOR_POSNEG;

This indicator took me 2 hours to code up.  I will get faster and better at this in time.  I used the DMI function in Sierra Chart and then defined my DMI+ and DMI- to output or Subgraphs from function.  Calculated my ratio variable and defined the output subgraph to the calculated ratio variable.
 
Here is a screenshot
 

No comments:

Post a Comment