Exemplo n.º 1
0
        public OptionStrike GetOptionStrike(int bankNiftyVal)
        {
            OptionStrike strike = new OptionStrike();
            int          modVal = bankNiftyVal % 100;

            if (modVal <= 35)
            {
                strike.CE = strike.PE = bankNiftyVal - modVal;
            }
            else if (modVal > 35 && modVal < 70)
            {
                strike.CE = bankNiftyVal + (100 - modVal);
                strike.PE = bankNiftyVal - modVal;
            }
            else
            {
                strike.CE = strike.PE = bankNiftyVal + (100 - modVal);
            }
            return(strike);
        }
Exemplo n.º 2
0
        private async void PlaceOrderForthisStategy(object obj)
        {
            if (DateTime.Now.Hour >= 11 && DateTime.Now.Minute > 1)
            {
                timer.Dispose();
                return;
            }
            OptionStrike optionStrike = new OptionStrike();

            if (CurrentBankNifty != null)
            {
                optionStrike = GetOptionStrike((int)CurrentBankNifty);
            }
            apiProcessor.IsCEOrder     = true;
            apiProcessor.IsPEOrder     = true;
            apiProcessor.CEStrike      = optionStrike.CE;
            apiProcessor.PEStrike      = optionStrike.PE;
            apiProcessor.LogAdded     += ApiProcessor_LogAdded;
            apiProcessor.UserTransType = "SELL";
            await apiProcessor.PlaceEntryOrder();
        }