Creating programmaticaly a stereotype is more difficult, you need to:
get the "LocalModule" module
find the "LocalProfile" profile
create the stereotype inside
The following macro to apply to a "LocalProfile" profile should work:
# assume 'elt' is the selected "LocalProfile" profile
stereotype = session.getModel().createElement("Infrastructure.Stereotype")
stereotype.setName("CarRequirement") # the stereotype name
stereotype.setBaseClassName("Analyst.Requirement") # the metaclass the stereotype applies to
elt.getDefinedStereotype().add(stereotype)