Options Strategies - NSE F&O
This gem helps you to use the Options pre-defined strategies with the respective inputs and also allows to create the custom strategy as you want.
Installation
Install the gem and add to the application's Gemfile by executing:
$ bundle add -strategies
If bundler is not being used to manage dependencies, install the gem by executing:
$ gem install -strategies
Usage
require 'options-strategies'
= {:index_name=>"NIFTY", :spot_price=>17840}
LongStraddle.new().build.to_hash
==> {"LONG"=>[{"strike_price"=>17850, "index_name"=>"NIFTY", "default_units"=>50, "size"=>1, "execute_units"=>50, "option_type"=>"CEOption"}, {"strike_price"=>17850, "index_name"=>"NIFTY", "default_units"=>50, "size"=>1, "execute_units"=>50, "option_type"=>"PEOption"}], "SHORT"=>[], "index_name"=>"NIFTY", "spot_price"=>17840, "strike_price"=>17850, "klass_name"=>"LongStraddle"}
or
= {:index_name=>"BANKNIFTY", :spot_price=>40000}
LongStraddle.new().build.to_hash
{"LONG"=>[{"strike_price"=>40000, "index_name"=>"BANKNIFTY", "default_units"=>25, "size"=>1, "execute_units"=>25, "option_type"=>"CEOption"}, {"strike_price"=>40000, "index_name"=>"BANKNIFTY", "default_units"=>25, "size"=>1, "execute_units"=>25, "option_type"=>"PEOption"}], "SHORT"=>[], "index_name"=>"BANKNIFTY", "spot_price"=>40000, "strike_price"=>40000, "klass_name"=>"LongStraddle"}
Implemented Strategies
- LongCall
- LongPut
- ShortCall
- ShortPut
- ShortStrangle
- ShortStraddle
- IronCondor
- IronFly
- LongIronCondor
- LongIronFly
- BullCallSpread
- BullPutSpread
- BearPutSpread
- BearCallSpread
- CallRatioBackSpread
- PutRatioBackSpread
- PutRatioSpread
- CallRatioSpread
- LongCallLadder
- LongPutLadder
- ShortCallLadder
- ShortPutLadder
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/kann87/options-strategies. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Options::Strategies project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.