Skip to content

Instantly share code, notes, and snippets.

View botany02's full-sized avatar

Botany02 botany02

View GitHub Profile
@botany02
botany02 / FREEZE_QTY.txt
Last active April 26, 2024 14:40
FREEZE_QTY.txt
SYMBOL,FREEZEQTY
BANKNIFTY,900
FINNIFTY,1800
MIDCPNIFTY,4200
NIFTY,1800
AARTIIND,40000
ABB,5000
ABBOTINDIA,1200
ABCAPITAL,162000
ABFRL,104000
@botany02
botany02 / ORB_SL_Entry.afl
Last active August 27, 2020 05:43
Demo Trading System with SL Entry
/*
Demo Trading System with BO-SL Entry
ORB with SL Entry
Coded by ChokS
https://howutrade.in
[email protected]
*/
_SECTION_BEGIN("CHART_OPTIONS");
@botany02
botany02 / Custom_Backtester_trade_x_symbols.afl
Created July 30, 2020 07:05
Custom Backtester to trade only on first x Symbols
/*
Custom Backtester to Trade only on First x Symbols
Coded by ChokS
https://howutrade.in
The 'MaxOpenPositions' setting is used to limit the number of open positions at any point of time.
Example:
Say you are backtesting 100 symbols and set 'MaxOpenPositions' to 5,
This will limit the number of open positions to 5 at any point of time, but once a position is closed, new signal will be taken,
means trades may be taken for more than 5 symbols
@botany02
botany02 / Backtest_Template.afl
Last active November 21, 2024 02:12
Backtest Template for AmiBroker
/*
Backtest Template for Stocks AND Futures
Coded by ChokS
https://howutrade.in
Platform: AmiBroker/AFL
Features:
Commission Calculation (close to real brokerage)
Support for Stocks and Futures
@botany02
botany02 / Cumulative-Volume-Intraday.afl
Created February 6, 2019 02:06
Cumulative Volume for Intraday
_SECTION_BEGIN("Cumulative Volume");
/*
To get cumulative Volume for intraday, we need to Sum Volume from the beginning bar of the Day
Example :
9:15 - volume(9:15)
9:20 - volume(9:15+9:20)
9:25 -volume(9:15+9:20+9:25)
1. Get start bar of the day
@botany02
botany02 / ModifyAllBOStoploss.txt
Last active February 6, 2019 01:12
Modify All BO Stoploss - KiteNet
Public Function ModifyAllBOStoploss(ByVal ParentOrderId As String) As String
On Error GoTo ErrHandler:
'This is generic example to modify all BO stoploss at certain % from Ltp
'Modify the code to suit your requirements
'Make sure you are not calling this function in a loop
'Use static variables to restrict multiple calling of this function
Dim ModifyPct As Single
ModifyPct = 0.25 / 100 'Modify the stoploss with 0.25% from Ltp
@botany02
botany02 / UpstoxAPI-VBA
Created November 5, 2018 04:21
VBA module to get access token for Upstox API
Option Explicit
'Global Variables
'Adjust the below variables as required
Private Const ApiKey As String = "xxxxxxxxxxxxxxxxxxxxxxxxxxxyccLTA40xFY3vT"
Private Const ApiSecret As String = "xxxxxxxxxxxxxx4c0"
Private Const RedirectUrl As String = "https://howutrade.in"
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal Operation As String, ByVal Filename As String, _
Optional ByVal Parameters As String, Optional ByVal Directory As String, Optional ByVal WindowStyle As Long = vbMinimizedFocus) As Long
@botany02
botany02 / PriceCrossover.txt
Last active July 17, 2018 10:26
Function to check crossover of Price (Excel VBA)
Option Explicit
''Created By HowUTrade
'''https://howutrade.in
'''[email protected]
'Add Reference to 'Microsoft Scripting Runtime'
'VBA Editor --> Menu --> Tools --> References
'We declare two Dictionaries to hold values