From 2bf80cdc653b068651a8716f9c8bad881786009a Mon Sep 17 00:00:00 2001 From: Rishabh Joshi Date: Sat, 6 Oct 2018 19:37:03 +0530 Subject: [PATCH] Add constants to help place orders --- .../upstox/common/constants/DurationType.java | 30 +++++++++++++++++ .../upstox/common/constants/LiveFeedType.java | 30 +++++++++++++++++ .../upstox/common/constants/OrderType.java | 32 +++++++++++++++++++ .../upstox/common/constants/ProductType.java | 32 +++++++++++++++++++ .../common/constants/TransactionType.java | 30 +++++++++++++++++ 5 files changed, 154 insertions(+) create mode 100644 src/main/java/com/github/rishabh9/riko/upstox/common/constants/DurationType.java create mode 100644 src/main/java/com/github/rishabh9/riko/upstox/common/constants/LiveFeedType.java create mode 100644 src/main/java/com/github/rishabh9/riko/upstox/common/constants/OrderType.java create mode 100644 src/main/java/com/github/rishabh9/riko/upstox/common/constants/ProductType.java create mode 100644 src/main/java/com/github/rishabh9/riko/upstox/common/constants/TransactionType.java diff --git a/src/main/java/com/github/rishabh9/riko/upstox/common/constants/DurationType.java b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/DurationType.java new file mode 100644 index 0000000..9c3ffc2 --- /dev/null +++ b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/DurationType.java @@ -0,0 +1,30 @@ +/* + * MIT License + * + * Copyright (c) 2018 Rishabh Joshi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.rishabh9.riko.upstox.common.constants; + +public final class DurationType { + public static final String DAY = "DAY"; + public static final String IOC = "IOC"; +} diff --git a/src/main/java/com/github/rishabh9/riko/upstox/common/constants/LiveFeedType.java b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/LiveFeedType.java new file mode 100644 index 0000000..3a277ca --- /dev/null +++ b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/LiveFeedType.java @@ -0,0 +1,30 @@ +/* + * MIT License + * + * Copyright (c) 2018 Rishabh Joshi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.rishabh9.riko.upstox.common.constants; + +public final class LiveFeedType { + public static final String LTP = "LTP"; + public static final String FULL = "Full"; +} diff --git a/src/main/java/com/github/rishabh9/riko/upstox/common/constants/OrderType.java b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/OrderType.java new file mode 100644 index 0000000..2be5557 --- /dev/null +++ b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/OrderType.java @@ -0,0 +1,32 @@ +/* + * MIT License + * + * Copyright (c) 2018 Rishabh Joshi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.rishabh9.riko.upstox.common.constants; + +public final class OrderType { + public static final String MARKET = "M"; + public static final String LIMIT = "L"; + public static final String STOP_LOSS_LIMIT = "SL"; + public static final String STOP_LOSS_MARKET = "SL-M"; +} diff --git a/src/main/java/com/github/rishabh9/riko/upstox/common/constants/ProductType.java b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/ProductType.java new file mode 100644 index 0000000..660328c --- /dev/null +++ b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/ProductType.java @@ -0,0 +1,32 @@ +/* + * MIT License + * + * Copyright (c) 2018 Rishabh Joshi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.rishabh9.riko.upstox.common.constants; + +public final class ProductType { + public static final String INTRADAY = "I"; + public static final String DELIVERY = "D"; + public static final String COVER_ORDER = "CO"; + public static final String ONE_CANCELS_OTHER = "OCO"; +} diff --git a/src/main/java/com/github/rishabh9/riko/upstox/common/constants/TransactionType.java b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/TransactionType.java new file mode 100644 index 0000000..a3140b3 --- /dev/null +++ b/src/main/java/com/github/rishabh9/riko/upstox/common/constants/TransactionType.java @@ -0,0 +1,30 @@ +/* + * MIT License + * + * Copyright (c) 2018 Rishabh Joshi + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package com.github.rishabh9.riko.upstox.common.constants; + +public final class TransactionType { + public static final String BUY = "B"; + public static final String SELL = "S"; +}