Fine-Tuning the Buddha: Incorporating Micro Conditions

Micro Conditions For Stabalizing the Intraday Strategy

We deploy two type of exit strategy in same trading model.

Intraday: One is intraday i.e the trade is auto square off at the end of the day.

Positional: Another strategy is the positional approach, where either the trade will reach its stop loss or target, or it will be automatically squared off at the end of the 5-day period. Please note that these 5 days are calendar days and do not depend on whether the market is open for trading or not.

Micro Conditions For Stabalizing the Intraday Strategy

At the time of market opening, the market remains too volatile because of liquidity.  So, We start our trade at 9:20 AM. Similarly, We auto square off at 14:20 PM to avoid day end’s volatility!

Similarly, Apart from the initial conditions of entry, exit and trade management, Here are two set of micro conditions that govern the strategy for the purpose of better stability and ease of exeuction. 

Changing the parameters of these conditions does not alter the core startegy that much –

# Global Conditions

  • Entry Time Condition: It is an intraday strategy. So, if the trade is placed only when if the stock name comes between 9:20 AM to 14:20 PM.
  • Trade type and Stop Loss: It will long the stock with day’s high as target. If the stop loss does not hit, it will square off the trade anyways at 14:50 PM.
    •  But, in case of Positional Trades, the exit will be at day’s end. As it is positional trade, there is no sudden auto square off from the broker as well! 

# Skipping Gap Triggers

Although this case was already discussed but, In case of gap up above the previous day’s high or gap down below the previous day’s low, please avoid buying it or selling it respectively. It means – 

  • If there’s a gap up above the previous day’s high (the sell point), it implies that the sell trade has already been triggered, so we avoid this scenario.
  • Likewise, in the case of a gap down, we steer clear of situations where there’s a gap down below the previous day’s low (the buy point).

Importing Pandas:

					import pandas as pd

Here, we start by importing the Pandas library, a powerful data manipulation and analysis tool in Python. We typically use the alias “pd” to refer to Pandas throughout our code, which makes it easier to use Pandas functions.

Reading The CSV File:

In the previous chapter, We had store the dataset in different CSV files. Now, Lets assume You are importing the double_ib.csv file. It contains all the FNO stocks that has exhibited Double Inside Bar Pattern since 2015 to today. Note – The process of import is same for  index_ib.csv or tripple_ib.csv and nr7.csv.
					df = pd.read_csv("/your/path/here/double_ib.csv")


This line of code does the actual work of reading the CSV file. Let me explain each part:

  • pd.read_csv(): This is a Pandas function used to read CSV (Comma-Separated Values) files. It can read data from a local file or a URL.
  • "/your/path/here/double_ib.csv": This is the path to the CSV file you want to read. You would replace "/your/path/here/" with the actual path to the directory where your “double_ib.csv” file is located. Make sure to keep the file name and its extension (“.csv“) as it is.
  • df: This is a variable that will store the data from the CSV file as a Pandas DataFrame. You can choose any variable name you like; “df” is a common convention for a DataFrame variable name.

So, when you execute this code, it will read the data from the “double_ib.csv” file and store it in the variable df. You can then perform various data manipulation and analysis operations on this DataFrame using Pandas functions.”

Post a comment

Leave a Comment

Your email address will not be published. Required fields are marked *