• stock market

    Functional Programming in Java Using Lambda Expressions

    A lambda expression is a short and concise way to represent an anonymous function—a function without a name . Key Features 1.Why Lambda expression required Lambda expression required to enable functional programming ,lambda expression allow you to define small functions without naming them . this is useful when the function is simple and used only once or a few times . Lambda Syntax : 2.Lambda Expression Example Example 1: Addition of Number Without Lambda Expressions With Lambda Expressions Example 2: Find the length of String without Lambda Expressions With Lambda Expression if single statements are there then curly bracket not required , if body contained multiple lines of code then…

  • stock market

    SOLID Design Principles in Java – A Complete Guide with Examples

    SOLID is a set of five object-oriented design principles that help developers design clean, maintainable, scalable, and flexible software systems. These principles reduce tight coupling between classes, improve code readability, and make applications easier to extend and test. It is a set of 5 object-oriented design principles that help you write clean, maintainable, scalable, and testable Java code. Design patterns are often built on top of SOLID principles. 1.Single Responsibility Principle (SRP) there should never be more than one functionality for a class to change , single responsibility focused , single logic/functionality addresses a specific concern . Example: We have written a code in a single class that code is…

  • Scan candle,  stock market

    Python Script to Identify Doji Candlestick Patterns

    A Doji candlestick is a special type of candlestick pattern in the stock market that shows indecision between buyers and sellers. When doji candlestick forms, it indicates that the market opens and closes at the same price. This means there is equality and indecision between buyers and sellers, with no one controlling the market How a Doji Candle Looks Line-by-Line Explanation 1. Importing Libraries 2. Change Current Working Directory 3. Generate Trading Session Opens the file access_token.txt and reads the access token (used for authenticated API calls). Reads API key & secret from api_key.txt and splits into a list.Example: ["your_api_key", "your_api_secret"] Creates a KiteConnect object with your API key. Sets…

  • stock market

    How to fetch historical data using kite connect

    Algo Trading is a method of trading in the stock market where computer programs automatically place buy and sell orders based on pre-defined rules. These rules are created using mathematical models, technical indicators, or market conditions. Explanation Learn how to use the Zerodha Kite Connect API in Python to fetch historical stock data. This step-by-step guide explains each line of code Importing Required Libraries Change Working Directory Generate Trading Session Fetch All NSE Instruments Helper Function: Fetch Instrument Token Fetch Historical OHLC Data 1.instrument = fetchInstrument(instrument_df, ticker)→ Finds the instrument token for the stock. 2. kite.historical_data(...) 3. Converts the returned JSON data into a Pandas DataFrame. 4. data.set_index("date", inplace=True)→ Sets the…

  • stock market

    Understanding Zerodha’s place_order() Method in Python

    Zerodha’s Kite Connect API stands out as one of the most powerful tools available to Indian traders.It allows developers to place, modify, and monitor trades programmatically using simple Python code. At the heart of this functionality lies a crucial method — place_order().This method acts as the execution engine that places your buy or sell orders directly on the Zerodha trading platform. In this blog, we’ll break down the purpose, parameters, and practical examples of the place_order() function so that you can start placing trades like a pro. Purpose of place_order() The place_order() method is used to place a new order (either BUY or SELL) in your Zerodha account via the…

  • stock market

    How to Calculate Pivot Points in Python

    Pivot point is a leading indicator used to assess directional movement of an asset and potential support and resistance level . How to calculate pivot points. then we calculate supports and resistance levels. How to trade using pivot points 1. Range trading strategy 2.Breakout strategy 3. How to Implement pivot point using python Explanation of above code Returns all calculated levels as a tuple. Output looks like:(Pivot, R1, R2, R3, S1, S2, S3)

  • Candlestick-Pattern

    Mastering the Pin Bar Pattern:How to Trade the Pin Bar Candlestick Pattern Like a Pro

    Pin bar candlestick is one of the most famous candlestick it is widely used by price action traders to determine reversal points in the market . What is a Pin Bar Candlestick? A Pin Bar (Pinocchio Bar) is a powerful single-candle candlestick pattern that signals price rejection and a potential reversal in the market. It has: How to Identify pin bar Signals A Pin Bar candlestick is a powerful chart pattern in technical analysis. It is identified by a very long tail (or wick) that signals market rejection and indicates a possible reversal in price direction. A Bullish Pin Bar usually has a long lower wick, showing strong rejection of…

  • stock market

    How to Create Simple SMA Strategies in Python?

    A Simple Moving Average (SMA) strategy is one of the easiest and most popular techniques used in technical analysis for trading. It helps identify trends by smoothing out price fluctuations over a specific period. What Is Pandas? Pandas is an open-source Python library that provides high-performance, easy-to-use data structures and data analysis tools. It’s built on top of NumPy, and it’s especially useful for: What Is NumPy? NumPy is an open-source Python library that provides: 1. Steps to Create an SMA Strategy Using Python: 2. Reading the CSV File 3. Displaying the DataFrame This line just displays the contents of the DataFrame df. In a Jupyter Notebook or interactive environment,…

  • stock market

    What is Simple Moving Average(SMA)?

    The Simple Moving Average (SMA) is a widely used technical indicator in financial analysis and trading. It calculates the average price of an asset over a specific time period—like 50, or 200 days—by summing up the closing prices and dividing by the number of days. This helps smooth out short-term fluctuations and highlights longer-term trends. SMA (Simple Moving Average) is a commonly used technical indicator in stock and forex trading that helps smooth out price data by calculating the average closing price over a specific number of time periods. Formula: SMA = (P1 + P2 + ... + Pn) / n Where: Example: 1.What is SMA Crossover Strategy? The SMA…

  • stock market

    Anonymous Classes in Java and When to Use Them?

    An anonymous class in Java is a class without a name that is both defined and instantiated in a single expression. Developers commonly use anonymous classes to create instances of classes or implement interfaces without writing a separate named class. This helps in writing cleaner and more concise code, especially for short-term or one-time use cases in Java programming. Characteristics of Anonymous classes Anonymous class is Example: Example without Anonymous class 1. Greeting.java (Interface) 2. GreetingImpl.java (Interface Implementation) 3. DemoTest.java Example: Example with Anonymous class 2. DemoTest.java Explanation of Above code : Anonymous Inner classes An anonymous inner class in Java is a way to define and instantiate a class…

  • stock market

    Java 8 Features

    Java 8 was introduced to modernize Java by adding functional programming features, improving performance, and making the language more concise, readable, and expressive. It aimed to reduce boilerplate code, improve parallel processing, and enable more declarative coding styles—especially important for handling large data collections and multi-core processors. Lambda Expressions 2. Functional Interfaces 3. Default Method in Interface 4.Static Method in Interface Interface MyInterface { default void show() { System.out.println("Default method"); }} 5. Stream API list.stream().filter(s -> s.startsWith("A")).collect(Collectors.toList()); Intermediate (Non-Terminal) operations Example : Terminal operations 6. Method References 7. Optional Class 8. New Date and Time API (java.time package) Old API problems: New API advantages: 9. Collectors Class Commonly Used Collectors…

  • stock market

    How to define a target Audience

    Defining your target audience on social media is crucial for creating content that resonates and drives engagement . Attract target audience with free content or Ads on . 1. Google Forms What is google forms Key Features of Google Forms: Easy to Use: Simple drag-and-drop interface for adding questions and organizing content.Customizable: Offers themes, color options, and the ability to add images and videos.Question Types: Includes multiple-choice, dropdowns, checkboxes, linear scales, and text fields.Automatic Data Collection: Responses are collected directly in Google Sheets for easy analysis.Integration: Easily integrates with other Google services like Gmail, Drive, and Calendar.Free to Use: Available to anyone with a Google account. Common Use Cases: How to find a audience with 3-simple…