Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

Paul aka Aurbano

Newbie: #MustRead if you have troubles sizing your position

Recommended Posts

Paul aka Aurbano

Hello folks,

@Aiman 's Trend Trading Webinar and @Thor's VPAs Webinars inspired me to pursuit a new challenge this year 2021 : "move from a $50k account to a smaller one around $5k retiring funds and protecting the money; then work harder on my strategies and VPA for a "whole day run" kind of trade with the smallest position / smallest risk".

This has a lot to do with sizing the position according to your daily target and a realistic expectation of the stock movement during any given normal day (no catalysts, gaps or news). In this scenario, and to speed up things during the morning routine, I coded a small python script that helps me do some fast insights of a bunch of stocks using Yahoo Finance API. My IT background totally helped me getting this mini-app up & running smoothly in some hours and since then is a #must in my daily routine.

WHY ?  Easy ... I never go in on any stock with a bigger size and obviously I force my self to wait longer (2-4h) for the daily candle to develop.

WHAT TO EXPECT :

  • This is a small tool to help newbies sizing the position no matter the price of the stock but taking into consideration the daily profit target and the daily ticker ATR

STRATEGY explained :

  • Maximize profit and reduce risk to the minimum while focusing in the daily ranges break out strategies with 2-3 days continuation where the daily candle will surely be at least 100% of the ATR(14). Trying to open the position at the start of the day at a technical level and closing all or most of it in a couple of hours or at the end of the day. VPA will play a huge part in the game dictating levels for partials or full-exit around 80% of the daily ATR(14).
  • Live example of one trade management with a 20% partial + re-add + full-exit at 85% of the expected daily ATR(14). Ticker symbol $CCL. ATR(14) = $1.20. Date: 2021-12-27.

1774123519_20211227-190405CCLlong.thumb.jpg.b93fba72edf19f9975fec8d17eebe044.jpg

 

HOW ? Very easy ! Follow me in this simple steps :

  • Install Python 3.8 or above from here : https://www.python.org/downloads/windows/ ... you can find plenty of youtube videos helping you do so step by step (for window clic clic clic or mac)
  • Download the python script attached to this post... Due to forums limitations, change the file extension to .py after download and store it in a known location
  • Open a terminal (Windows button + typy cmd + enter)
  • Update installer Python command line installer (just in case)
python -m pip install --upgrade pip
  • Install some basic python libraries for data analazing, math, tables and yahoo finance api :
 python -m pip install pandas (press Intro)
 python -m pip install yfinance (press Intro)
 python -m pip install warnings (press Intro)
 python -m pip install math (press Intro)

20211228-195842.jpg.485aca1cda067c171c734c0fe2485c15.jpg

WHAT TO EXPECT ? Here is an example... If you got here the script should be run smoothly just by double click in the icon from the File Explorer (If you property installed python the script should be executable once you update the extension to .py) If the script doesn't work from File Explorer follow this link to add the Python path to the Environment variables so that you can run python everywhere (link: https://www.geeksforgeeks.org/how-to-add-python-to-windows-path/)

After setting your daily target and the Buying Power you want to use (newbies never leverage!) you will be prompted to enter some ticker symbols (12 max.) separated by spaces. The Script will contact to Yahoo Finance API to retrieve volume data for the last 9 days and calculate (in order) :

  • rvol - Relative Volume today (calculated before 9.30am)
  • tvol - Today's Volume between the ETH and 9.30am
  • avg_vol - Average Volume for the last 9 days before 9.30am (openning time).
  • ATR(14)p - Daily Average True Range for the last 14 days (in percent %)
  • ATR(14) - Daily Average True Range for the last 14 days (in dolars $)
  • 1/3 ATR SL - Price range for StopLoss when aiming a 1:3 risk:reward (in dolars $)
  • 1/4 ATR SL - Price range for StopLoss when aiming a 1:4 risk:reward (in dolars $)
  • max price - Top price expected for today given the scenario that the price open near PDC and move (smoothly or not) exactly 1xATR(14).
  • min price - Bottom price expected for today given the scenario that the price open near PDC and move (smoothly or not) exactly 1xATR(14).
  • Resistance - Top price expected for today given the scenario that the price range for today will be set this way : half ATR(14) above PDC and half ATR(14)  below PDC.
  • Support - Bottom price expected for today given the scenario that the price range for today will be set this way : half ATR(14) above PDC and half ATR(14)  below PDC.
  • max sh 4 BP - Max amount of share you will be able to adquire with your actual BP
  • sh/target - Amount of shares you will need for the ticker to achive 100% today's profit goal using 80% of today's ATR(14) on that ticker.
  • BP__check - Will show OK if you can afford the ticker or X if you cannot (because your actual BP is below the needs for your target)

 

Screenshot_20220113_101554.jpg.15bba8bc79a2c1df8f62817d22e1aa72.jpg

SPECIAL THANKS :

to @Andrew Aziz to join such a group of smart guys in this community and @KyleK29 and @Bryan W for take active part in the tech side of Trading 🙂 @Thor for giving so much love to the Volume Analysis ... my new mantra

 

 

 

share_size_calc_using_ATR_python_script.txt

Edited by Paul aka Aurbano
update v0.5
  • Like 1

Share this post


Link to post
Share on other sites
Paul aka Aurbano
27 minutes ago, peterB said:

can you explain it a bit more please?

Of course 🙂 my pleasure .... but please watch the Trend Trade Webinar here as Aiman gave the foundation of all this:
https://bearbulltraders.com/course/strategy-tuesday/lesson/trend-trading/topic/how-to-trade-trends-aiman/

so it tells you that you need to take 216 shares of CCL to achieve the $200 profit today.

That is exactly how it works @peterB. The script will review the ATR(14) from Yahoo Finance API and give you a an aproximation of how many shares you need to use in order to get to the profit, taking into consideration that you will try to get at least 80-85% of the expected daily move.

1. how do you know where to enter the stock?

Usually that depends on 3 things : VPA + Pivots + Daily trend. As I said, this strategy is related to @Aiman 's Trend Traading Webinar, where you look to maximize profits on daily range price break out (up or down) with no GAP or a very little one. Entry must be at a technical level (PDC, R3-4, S3-4, stop and struggle volume formation, volume ignition, etc)

Besides, the script will project several price levels related of the ATR(14) projection for the day, taking 3 scenarios into consideration as reference:

  1. The price will open near PDC and go up
  2. The price will open near PDC and go down
  3. The price will range near PDC all day long giving 1/2 ATR(14) up and 1/2 ATR(14) down

2.how does the add up on your picture relates to the target? if you just add up to the desired position of 216 your avg price will be different.

The small add actually does not move my whole picture, but only adds up a small profit to the target or move closser the final target price. 100% of the time I setup a new StopLoss for the add ONLY and leave the original stop with the 80% of the position at its original level.

3. how do you know where to put the stop?

You've got 2 methods : a) 5min entry candle range break out (in the opposite direction of your entry) ... or b) 1/3 of the daily profit target ... or whatever comes first.

4. how do you know your risk per the trade?

In Trend Trading, you usually aim for a 1:3 or 1:4 minimum Risk:Reward Ratio .... in the example of the post where the move expectation is around $1 ... you set up your SL between 1/3 and 1/4 of the target meaning : $0.25-$0.30 range from the entry.

 

 

 

 

Edited by Paul aka Aurbano

Share this post


Link to post
Share on other sites
Paul aka Aurbano

@peterB your risk level must be between 25% and 30% of the daily profit target so between $50-$60.

Besides the BP calcs, that is very interesting and never thought about it ... will try to update the script and upload some changes to give the user more info about those 2 things 🙂 thanks for the tip!

Share this post


Link to post
Share on other sites
Paul aka Aurbano

Update for the code ... I think that hotkeys must NEVER take actions that you don't fully understand unless you are an experienced trader... I personally struggled at the beginning with this matter.

 

20211229-115237.jpg.52b36c4bbc4fa3d25ec62ac1a4fb719b.jpg

 

Always refer to the first post of the thread to download the last version of the code ...

Edited by Paul aka Aurbano
update code link
  • Like 3

Share this post


Link to post
Share on other sites
Alastair

@Paul aka Aurbano  I think u and @Aiman should do a joint presentation on this tool. as it can be very impactful to both new and experienced traders.  Again thanks for this contribution.  U have again forced me to learn another  tool, Python, which I cam happy to do.   

Great to see u back in the room.

  • Like 1

Share this post


Link to post
Share on other sites
Paul aka Aurbano
10 hours ago, Alastair said:

@Paul aka Aurbano  I think u and @Aiman should do a joint presentation on this tool. as it can be very impactful to both new and experienced traders.  Again thanks for this contribution.  U have again forced me to learn another  tool, Python, which I cam happy to do.   

Great to see u back in the room.

hello @Alastair ... that is great that you took some time and tested the script hehehe

python is really easy to read (not so easy to write) and I took some time to comment most important things inside the code... hope this settle the base for a bigger/better development 🙂

Share this post


Link to post
Share on other sites
dmiles

@Paul aka Aurbano I agree with @Alastair, good to see you back here, and in chat!

I downloaded your script, thanks for posting! I plan on using it when considering entering a trade, and will gladly report back how it goes.

Happy New Year!

Share this post


Link to post
Share on other sites
Paul aka Aurbano

Some more examples of good sizing and ATR optimization from today with $CCL and $F :

1235541609_20220106-162151Fshort.thumb.jpg.88ba0635754d814a81207e6b9047b888.jpg

1040506380_20220106-100500CCLshort.thumb.jpg.d1874e56e305e1504722700783d8faa7.jpg

 

Share this post


Link to post
Share on other sites
Paul aka Aurbano
On 12/29/2021 at 10:32 AM, peterB said:

so 216*0.25 means $54 risk to get your $200 target of 1/4 R/R
so you might add one more line which would indicate the stop loss size for the stocks ATR and maybe count the BP needed as with small account the recomended position size might be out of the users BP so you should know before that you cant afford this stock to play with its full potential.

 

hi @peterB ... missed the part where you gave the idea of adding the SL price move for every single ticker ... modified the script and added a new line with 1/3 and 1/4 of the $ATR(14)... Hope it helps !

Screenshot_20220113_101554.jpg.89cac12f97b90452f9ed8718a146bc40.jpg

PS : as always, get the code update from the main post

Edited by Paul aka Aurbano
add screenshot

Share this post


Link to post
Share on other sites
Paul aka Aurbano

i will keep updating some more trend trading charts when possible. Hope @Aiman can find some time in the agenda and help us with this little project 🙂

 

20220114-204736.thumb.jpg.4fd639c66d93aca1d6c8a7659868f70f.jpg

Share this post


Link to post
Share on other sites
Paul aka Aurbano

short trade on $MU ... same rules apply : all-out after ATR or huge technical level step

1775342859_20220119-161454MUshort.thumb.jpg.e02713efbae6151e0b067fdbc65c01ec.jpg

Edited by Paul aka Aurbano
spelling correction

Share this post


Link to post
Share on other sites

[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.