[Haskell-cafe] Re: Composing trading strategies (was: Should I step into a minefield? / Writing a trading studio in Haskell)

Greg Fitzgerald garious at gmail.com
Thu Nov 8 17:37:37 EST 2007


Hi Joel,

> Can you post a couple of examples of what the trading strategies look
like?

Here are some very simple strategies, which are written in the context of
just one stock.  If these aren't very convincing, could you post some more
complex strategies that you'd like to see built using this library?

-- open long when price drops to 109.34
myOpenStrategy = limitOrder 109.34

-- close after done increasing or price drops below 105.12
myCloseStrategy openPrice = increasing openPrice <|> limitOrder 105.12

-- succeed when the current price reaches or drops below the given price
limitOrder price = satisfy (<= price)

Thanks,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071108/8ea28ac9/attachment.htm


More information about the Haskell-Cafe mailing list