SlideShare a Scribd company logo
Python for Traders
< Introduction to Python for Trading – Chapter 1 >
{
}
...
About Me
● Trading Since 2006 onwards
● Writing about Markets Since 2007 onwards
● Trainer Since 2013 onwards
Expertise in
○ Market Profile
○ Orderflow Analytics
○ Volume Spread Analysis
○ Amibroker AFL Programming
○ Tradingview Pinescript Programming
○ Python Programming
learn.marketcalls.in
Table of contents
Setting Python Environment, Learning
Basic Syntax, variables, data types
Learn conditional statements and
loops
Create reusable functions, class and
brief overview of libraries
01
02
03
Python Basics
Control Structures
Functions & Libraries
learn.marketcalls.in
Python Environment
● Install Python https://www.python.org/downloads/
● Install VS Code https://code.visualstudio.com/
● Install Python, Pylance & Jupiter extensions in VS Code
Installation Guidelines (PDF Material) available in the
course section
learn.marketcalls.in
Why To
Learn
Python?
learn.marketcalls.in
Python 3.x Version Timeline
Version Release Date Major Features
3.0 2008-12-03 Initial Release of Python 3
3.1 2009-06-27 Ordered Dictionaries, new io module
3.2 2011-02-20 Stable ABI, concurrent.futures module
3.3 2012-09-29 yield from, u'unicode' syntax
3.4 2014-03-16 asyncio, pip as default package manager
3.5 2015-09-13 async/await, type hinting
3.6 2016-12-23 Formatted string literals, secrets module
3.7 2018-06-27 Data classes, contextvars module
3.8 2019-10-14 Walrus operator, f-strings support = expressions
3.9 2020-10-05 Dictionary union operators, zoneinfo module
3.10 2021-10-04 Pattern matching, parenthesized context managers
3.11 2022-10-03 Exception Groups, self type, TOML in stdlib
3.12 2023-10-02 Hypothetical features
3.13 2024-10-01 Hypothetical features
Check Python Version
from command prompt
learn.marketcalls.in
Python IDE
VS Code PyCharm Spyder
learn.marketcalls.in
Cloud based environments
Google Colab Kaggle Watson Studio
learn.marketcalls.in
Jupyter Notebook
PIP Commands
Important pip commands
pip install yfinance
pip install –upgrade yfinance
pip list
PIP Overview
• Package manager for Python
• Stands for "Pip Installs Packages“
Simplified Package Management
• Facilitates easy installation of
third-party Python packages
• Streamlines upgrading and
removal of packages
learn.marketcalls.in
Understanding Data Types
Represents real numbers
(numbers with decimal
points). For example,
3.14 or -0.001
Represents whole
numbers, both positive
and negative. For
example, 5 or -42.
Integer (int) Float
{
}
learn.marketcalls.in
Variables
● A variable in
programming is a
symbolic name or
identifier that
represents a value
or a piece of data
stored in a
computer's
memory.
● Variables are used
to store,
manipulate, and
retrieve data within
Understanding Data Types
Represents either True
or False, used for
logical operations and
comparisons.
Represents sequences of
characters, enclosed in
single or double quotes.
For example, "Hello,
World!" or 'Python'
String (str) Boolean (bool)
{
}
learn.marketcalls.in
Conditional Operators
Operator Description Example Result Description
== Equal to a == b True if a is equal to b
!= Not equal to a != b True if a is not equal to b
> Greater than a > b True if a is greater than b
< Less than a < b True if a is less than b
>= Greater than or equal to a >= b
True if a is greater than or equal
to b
<= Less than or equal to a <= b True if a is less than or equal to b
and Logical AND a > 5 and b < 10 True if both conditions are true
or Logical OR a < 5 or b > 10
True if at least one condition is
true
not Logical NOT not(a == b) True if the condition is not true
F-String Formatting
Understanding Data Types
Represents ordered
collections of
items. Lists are
mutable
Similar to lists but
immutable. Often used
for grouping related
data
Represents key-
value pairs, where
each value is
associated with a
unique key
Represents unordered
collections of unique
elements. Sets do not
allow duplicates
List
Dict
Tuple
Set
List
• A list is an ordered collection of items, where each item can be of different data types.
• Lists are mutable, which means you can change their contents (add, remove, or modify elements).
learn.marketcalls.in
Tuple
• A tuple is similar to a list but is immutable, meaning you cannot change its contents after creation.
• Tuples are often used to represent fixed sets of related data.
learn.marketcalls.in
Dictionary (dict):
• A dictionary is a collection of key-value pairs, where each key is unique and associated with a value.
• Dictionaries are useful for storing and retrieving data based on specific identifiers.
learn.marketcalls.in
Set
• A set is an unordered collection of unique elements.
• Sets are handy when you need to maintain a collection of distinct items.
learn.marketcalls.in
If-Else Structure
learn.marketcalls.in
For Loop
learn.marketcalls.in
User Defined Function
Class Example
1.Class:
•A class is a blueprint or template for creating objects (instances).
•It defines the attributes (data) and behaviors (methods) that its objects will have.
•Classes serve as a blueprint for creating multiple objects with similar characteristics and behaviors.
2.Object:
•An object is an instance of a class.
•It is a concrete, real-world entity created from the class blueprint.
•Objects have their own unique attributes (values for class variables) and can perform actions (invoke
methods) defined in the class.
3.Method:
•A method is a function that is defined within a class and operates on class attributes.
•Methods define the behaviors or actions that objects of the class can perform.
•Methods can access and modify the attributes of the class or perform specific operations related to the
class.
4.Constructor:
•A constructor is a special method in a class that is automatically called when an object of the class is
created.
•It typically initializes the object's attributes with initial values.
•In Python, the constructor method is named __init__ and is used to set up the initial state of an object.
•Constructors can accept parameters to customize the initialization of objects.
learn.marketcalls.in
Popular Python Libraries
Importing Python Libraries
CREDITS: This presentation template was created by
Slidesgo, and includes icons by Flaticon, and
infographics & images by Freepik
Thanks!
< Do you have any questions? >
rajandran@marketcalls.in
Phone +91 9535133445
Whatsapp +91 9901867760
learn.marketcalls.in

More Related Content

Similar to Python for Traders - Introduction to Python for Trading (20)

PPTX
MODULE -1 Introduction to python -notes-grade 8).pptx
SUMYVINOD
 
PDF
python interview prep question , 52 questions
gokul174578
 
PPTX
Advance Python programming languages-Simple Easy learning
sherinjoyson
 
PPT
Java basics
Jitender Jain
 
PDF
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
PPTX
Apponix Python Full stack Training course
056kevinChauhan
 
PDF
C++ Programming Program Design Including Data Structures 7th Edition Malik So...
ceejwoija7603
 
PDF
pls-genai-boost-2408-student-slides-9.pdf
SreenivasuluG17
 
PDF
Introduction to Datastore
Software Park Thailand
 
PDF
PPT. Introduction & Views - Documentation.pdf
wzsyqxyb7m
 
ODP
Introduction to programming with python
Porimol Chandro
 
PDF
Python Programming - VI. Classes and Objects
Ranel Padon
 
PDF
Unit 4- Software Engineering System Model Notes
arvind pandey
 
PDF
🐍⚡ “Python Panache: Code Like a Pro, Not a Programmer!”
yashikanigam1
 
PPTX
UNIT_5_Data Wrangling.pptx
BhagyasriPatel2
 
PPTX
fINAL ML PPT.pptx
19445KNithinbabu
 
PPTX
python programming control structures.pptx
vimalak8
 
ODP
James Jesus Bermas on Crash Course on Python
CP-Union
 
PPTX
The Awesome Python Class Part-4
Binay Kumar Ray
 
PPTX
100% practical Basic Python for Data Science
Molyko Buea
 
MODULE -1 Introduction to python -notes-grade 8).pptx
SUMYVINOD
 
python interview prep question , 52 questions
gokul174578
 
Advance Python programming languages-Simple Easy learning
sherinjoyson
 
Java basics
Jitender Jain
 
UNIT1- OBJECT ORIENTED PROGRAMMING IN JAVA- AIML IT-SPPU
ApurvaLaddha
 
Apponix Python Full stack Training course
056kevinChauhan
 
C++ Programming Program Design Including Data Structures 7th Edition Malik So...
ceejwoija7603
 
pls-genai-boost-2408-student-slides-9.pdf
SreenivasuluG17
 
Introduction to Datastore
Software Park Thailand
 
PPT. Introduction & Views - Documentation.pdf
wzsyqxyb7m
 
Introduction to programming with python
Porimol Chandro
 
Python Programming - VI. Classes and Objects
Ranel Padon
 
Unit 4- Software Engineering System Model Notes
arvind pandey
 
🐍⚡ “Python Panache: Code Like a Pro, Not a Programmer!”
yashikanigam1
 
UNIT_5_Data Wrangling.pptx
BhagyasriPatel2
 
fINAL ML PPT.pptx
19445KNithinbabu
 
python programming control structures.pptx
vimalak8
 
James Jesus Bermas on Crash Course on Python
CP-Union
 
The Awesome Python Class Part-4
Binay Kumar Ray
 
100% practical Basic Python for Data Science
Molyko Buea
 

More from Marketcalls (20)

PPTX
Trading API and Automation – Quantageddon 2.0 @ IIT Chennai
Marketcalls
 
PPTX
OpenAlgo - Algotrading Platform for Everyone
Marketcalls
 
PPTX
Line Trading Automation - Algomojo Amibroker Module
Marketcalls
 
PPTX
Introduction to Option Greeks
Marketcalls
 
PDF
New margin requirement for popular futures and options strategies
Marketcalls
 
PPTX
Tradestudio 5.0 - Documentation
Marketcalls
 
PDF
Trading Money on 2nd OCT 2019 - Market Outlook
Marketcalls
 
PPTX
Trading money on 22nd sep 2019
Marketcalls
 
PPTX
Budget 2019 - Nifty Futures Intraday Price Action
Marketcalls
 
PPTX
Trading options and market profile
Marketcalls
 
PPTX
Custom Algo Development - Marketcalls
Marketcalls
 
PPTX
Tradezilla 2.0 - Discover Your Trading Edge Using Market Profile and Orderflow
Marketcalls
 
PPTX
Trading Strategies for Active Traders
Marketcalls
 
PDF
Marketcalls slack 24th dec 2018
Marketcalls
 
PPTX
Introduction to Algoaction -Web Based Trading Platform
Marketcalls
 
PPTX
Amibroker Fast Track Course Bangalore
Marketcalls
 
PPTX
Market profile - ATMA 42nd Educational Meeting
Marketcalls
 
PPTX
LinTRA – Intraday Trading System
Marketcalls
 
PPTX
TradeZilla - Trading system Design
Marketcalls
 
PPTX
Tradezilla Daily market commentary 2nd mar 2016
Marketcalls
 
Trading API and Automation – Quantageddon 2.0 @ IIT Chennai
Marketcalls
 
OpenAlgo - Algotrading Platform for Everyone
Marketcalls
 
Line Trading Automation - Algomojo Amibroker Module
Marketcalls
 
Introduction to Option Greeks
Marketcalls
 
New margin requirement for popular futures and options strategies
Marketcalls
 
Tradestudio 5.0 - Documentation
Marketcalls
 
Trading Money on 2nd OCT 2019 - Market Outlook
Marketcalls
 
Trading money on 22nd sep 2019
Marketcalls
 
Budget 2019 - Nifty Futures Intraday Price Action
Marketcalls
 
Trading options and market profile
Marketcalls
 
Custom Algo Development - Marketcalls
Marketcalls
 
Tradezilla 2.0 - Discover Your Trading Edge Using Market Profile and Orderflow
Marketcalls
 
Trading Strategies for Active Traders
Marketcalls
 
Marketcalls slack 24th dec 2018
Marketcalls
 
Introduction to Algoaction -Web Based Trading Platform
Marketcalls
 
Amibroker Fast Track Course Bangalore
Marketcalls
 
Market profile - ATMA 42nd Educational Meeting
Marketcalls
 
LinTRA – Intraday Trading System
Marketcalls
 
TradeZilla - Trading system Design
Marketcalls
 
Tradezilla Daily market commentary 2nd mar 2016
Marketcalls
 
Ad

Recently uploaded (20)

PDF
List of all the AI prompt cheat codes.pdf
Avijit Kumar Roy
 
PDF
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
PPTX
Rocket-Launched-PowerPoint-Template.pptx
Arden31
 
PDF
Performance Report Sample (Draft7).pdf
AmgadMaher5
 
PPTX
Hadoop_EcoSystem slide by CIDAC India.pptx
migbaruget
 
PDF
Incident Response and Digital Forensics Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
AI Project Cycle and Ethical Frameworks.pptx
RiddhimaVarshney1
 
PPTX
Introduction to Artificial Intelligence.pptx
StarToon1
 
PDF
How to Avoid 7 Costly Mainframe Migration Mistakes
JP Infra Pvt Ltd
 
PDF
Context Engineering vs. Prompt Engineering, A Comprehensive Guide.pdf
Tamanna
 
PPT
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
PPTX
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
PPTX
fashion industry boom.pptx an economics project
TGMPandeyji
 
PPTX
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
PDF
WEF_Future_of_Global_Fintech_Second_Edition_2025.pdf
AproximacionAlFuturo
 
PDF
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
PDF
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
PDF
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
PDF
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
PPTX
This PowerPoint presentation titled "Data Visualization: Turning Data into In...
HemaDivyaKantamaneni
 
List of all the AI prompt cheat codes.pdf
Avijit Kumar Roy
 
apidays Helsinki & North 2025 - REST in Peace? Hunting the Dominant Design fo...
apidays
 
Rocket-Launched-PowerPoint-Template.pptx
Arden31
 
Performance Report Sample (Draft7).pdf
AmgadMaher5
 
Hadoop_EcoSystem slide by CIDAC India.pptx
migbaruget
 
Incident Response and Digital Forensics Certificate
VICTOR MAESTRE RAMIREZ
 
AI Project Cycle and Ethical Frameworks.pptx
RiddhimaVarshney1
 
Introduction to Artificial Intelligence.pptx
StarToon1
 
How to Avoid 7 Costly Mainframe Migration Mistakes
JP Infra Pvt Ltd
 
Context Engineering vs. Prompt Engineering, A Comprehensive Guide.pdf
Tamanna
 
01 presentation finyyyal معهد معايره.ppt
eltohamym057
 
GenAI-Introduction-to-Copilot-for-Bing-March-2025-FOR-HUB.pptx
cleydsonborges1
 
fashion industry boom.pptx an economics project
TGMPandeyji
 
recruitment Presentation.pptxhdhshhshshhehh
devraj40467
 
WEF_Future_of_Global_Fintech_Second_Edition_2025.pdf
AproximacionAlFuturo
 
apidays Helsinki & North 2025 - Monetizing AI APIs: The New API Economy, Alla...
apidays
 
What does good look like - CRAP Brighton 8 July 2025
Jan Kierzyk
 
MusicVideoProjectRubric Animation production music video.pdf
ALBERTIANCASUGA
 
apidays Helsinki & North 2025 - API-Powered Journeys: Mobility in an API-Driv...
apidays
 
This PowerPoint presentation titled "Data Visualization: Turning Data into In...
HemaDivyaKantamaneni
 
Ad

Python for Traders - Introduction to Python for Trading

  • 1. Python for Traders < Introduction to Python for Trading – Chapter 1 > { } ...
  • 2. About Me ● Trading Since 2006 onwards ● Writing about Markets Since 2007 onwards ● Trainer Since 2013 onwards Expertise in ○ Market Profile ○ Orderflow Analytics ○ Volume Spread Analysis ○ Amibroker AFL Programming ○ Tradingview Pinescript Programming ○ Python Programming learn.marketcalls.in
  • 3. Table of contents Setting Python Environment, Learning Basic Syntax, variables, data types Learn conditional statements and loops Create reusable functions, class and brief overview of libraries 01 02 03 Python Basics Control Structures Functions & Libraries learn.marketcalls.in
  • 4. Python Environment ● Install Python https://www.python.org/downloads/ ● Install VS Code https://code.visualstudio.com/ ● Install Python, Pylance & Jupiter extensions in VS Code Installation Guidelines (PDF Material) available in the course section learn.marketcalls.in
  • 6. Python 3.x Version Timeline Version Release Date Major Features 3.0 2008-12-03 Initial Release of Python 3 3.1 2009-06-27 Ordered Dictionaries, new io module 3.2 2011-02-20 Stable ABI, concurrent.futures module 3.3 2012-09-29 yield from, u'unicode' syntax 3.4 2014-03-16 asyncio, pip as default package manager 3.5 2015-09-13 async/await, type hinting 3.6 2016-12-23 Formatted string literals, secrets module 3.7 2018-06-27 Data classes, contextvars module 3.8 2019-10-14 Walrus operator, f-strings support = expressions 3.9 2020-10-05 Dictionary union operators, zoneinfo module 3.10 2021-10-04 Pattern matching, parenthesized context managers 3.11 2022-10-03 Exception Groups, self type, TOML in stdlib 3.12 2023-10-02 Hypothetical features 3.13 2024-10-01 Hypothetical features Check Python Version from command prompt learn.marketcalls.in
  • 7. Python IDE VS Code PyCharm Spyder learn.marketcalls.in
  • 8. Cloud based environments Google Colab Kaggle Watson Studio learn.marketcalls.in
  • 10. PIP Commands Important pip commands pip install yfinance pip install –upgrade yfinance pip list PIP Overview • Package manager for Python • Stands for "Pip Installs Packages“ Simplified Package Management • Facilitates easy installation of third-party Python packages • Streamlines upgrading and removal of packages learn.marketcalls.in
  • 11. Understanding Data Types Represents real numbers (numbers with decimal points). For example, 3.14 or -0.001 Represents whole numbers, both positive and negative. For example, 5 or -42. Integer (int) Float { } learn.marketcalls.in
  • 12. Variables ● A variable in programming is a symbolic name or identifier that represents a value or a piece of data stored in a computer's memory. ● Variables are used to store, manipulate, and retrieve data within
  • 13. Understanding Data Types Represents either True or False, used for logical operations and comparisons. Represents sequences of characters, enclosed in single or double quotes. For example, "Hello, World!" or 'Python' String (str) Boolean (bool) { } learn.marketcalls.in
  • 14. Conditional Operators Operator Description Example Result Description == Equal to a == b True if a is equal to b != Not equal to a != b True if a is not equal to b > Greater than a > b True if a is greater than b < Less than a < b True if a is less than b >= Greater than or equal to a >= b True if a is greater than or equal to b <= Less than or equal to a <= b True if a is less than or equal to b and Logical AND a > 5 and b < 10 True if both conditions are true or Logical OR a < 5 or b > 10 True if at least one condition is true not Logical NOT not(a == b) True if the condition is not true
  • 16. Understanding Data Types Represents ordered collections of items. Lists are mutable Similar to lists but immutable. Often used for grouping related data Represents key- value pairs, where each value is associated with a unique key Represents unordered collections of unique elements. Sets do not allow duplicates List Dict Tuple Set
  • 17. List • A list is an ordered collection of items, where each item can be of different data types. • Lists are mutable, which means you can change their contents (add, remove, or modify elements). learn.marketcalls.in
  • 18. Tuple • A tuple is similar to a list but is immutable, meaning you cannot change its contents after creation. • Tuples are often used to represent fixed sets of related data. learn.marketcalls.in
  • 19. Dictionary (dict): • A dictionary is a collection of key-value pairs, where each key is unique and associated with a value. • Dictionaries are useful for storing and retrieving data based on specific identifiers. learn.marketcalls.in
  • 20. Set • A set is an unordered collection of unique elements. • Sets are handy when you need to maintain a collection of distinct items. learn.marketcalls.in
  • 25. 1.Class: •A class is a blueprint or template for creating objects (instances). •It defines the attributes (data) and behaviors (methods) that its objects will have. •Classes serve as a blueprint for creating multiple objects with similar characteristics and behaviors. 2.Object: •An object is an instance of a class. •It is a concrete, real-world entity created from the class blueprint. •Objects have their own unique attributes (values for class variables) and can perform actions (invoke methods) defined in the class. 3.Method: •A method is a function that is defined within a class and operates on class attributes. •Methods define the behaviors or actions that objects of the class can perform. •Methods can access and modify the attributes of the class or perform specific operations related to the class. 4.Constructor: •A constructor is a special method in a class that is automatically called when an object of the class is created. •It typically initializes the object's attributes with initial values. •In Python, the constructor method is named __init__ and is used to set up the initial state of an object. •Constructors can accept parameters to customize the initialization of objects. learn.marketcalls.in
  • 28. CREDITS: This presentation template was created by Slidesgo, and includes icons by Flaticon, and infographics & images by Freepik Thanks! < Do you have any questions? > [email protected] Phone +91 9535133445 Whatsapp +91 9901867760 learn.marketcalls.in