1. A method for automatically generating software code in a target language for modeling and valuing financial instruments, comprising the steps of: a) developing a problem specification for the financial instrument including— defining the financial instrument as problem specification, comparing said problem specification with constraints within a knowledge base, invoking heuristics within said knowledge base to further define said problem specification; b) formulating a financial model of the problem specification, including— producing one or more templates associated with a Monte Carlo Simulation describing said financial model; c) generating software code in said target language based on said templates; and d) running said software code on a computer with user-defined variables to value said financial instrument.