Tag Archives: positions

Demo of automated trading Positions management Python Script

Demo of Positions management Python Script

A demo of primitive position management but I track import metrics for automatic trading exits when positions are put on

If you want this script among many more, please join my Quant Elite membership

Join my FREE newsletter to learn more about how Python can help my algo trading infrastructure

 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Demo MySQL C Insert Java Select with Positions Database Table

Demo MySQL C Insert Java Select with Positions Database Table

A nice a combo of MYSQL calls

Join my FREE newsletter to to learn how much 

 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Demo report of automated positions management on long short trading with stop loss

Demo report of automated positions management on long short trading with stop loss

A video of this has been created but go here to see everything step for the new automated trading system

Join our FREE newsletter tosee when this system goes live

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Watchlist demo of trading pairs for when to put of positions for automated trading profitl

Watchlist demo of trading pairs for when to put of positions for automated trading profitl

This is the nerve center of our trading analytics system which will monitor when set positions on in an automated way.

I demo here what set of files you can expect with my new uew analytics system where you can see that here

Join my FREE newsletter to learn when this new system is ready to go

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

My Postgres SQL for positions to test this Kelly Criterion Matlab script for self imposed risk management during trading

My Postgres SQL for positions to test this Kelly Criterion Matlab script for self imposed risk management during trading

Nothing special but use Razor SQL to save yourself a hassles of manually typing this up in some shell script

Join my FREE newsletter to learn about this Postgres SQL data base for trading

INSERT INTO test.test.positions
(idx, longentryprice, longentrytimestamp, longentrytimestr, longexitprice, longexittimestamp, longexittimestr, longlowstop, longlowtarget, longsofttargperc, longstoplossper, longsymbol, longupstop, longuptarget, shortentryprice, shortentrytimestamp, shortentrytimestr, shortexitprice, shortexittimestamp, shortexittimestr, shortlowstop, shortlowtarget, shortsofttargperc, shortstoplossper, shortsymbol, shortupstop, shortuptarget)
VALUES
(1, ’10’, 0, ‘0’, ’15’, 0, ‘0’, ‘0’, ‘0’, 0, 0, ‘F’, ‘0’, ‘0’, ‘1’, 0, ‘0’, ‘1.5’, 0, ‘0’, ‘0’, ‘0’, 0, 0, ‘GM’, ‘0’, ‘0’)

 

or use this:

 

INSERT INTO test.test.positions
    (idx, longentryprice, longentrytimestamp, longentrytimestr, longexitprice, longexittimestamp, longexittimestr, longlowstop, longlowtarget, longsofttargperc, longstoplossper, longsymbol, longupstop, longuptarget, shortentryprice, shortentrytimestamp, shortentrytimestr, shortexitprice, shortexittimestamp, shortexittimestr, shortlowstop, shortlowtarget, shortsofttargperc, shortstoplossper, shortsymbol, shortupstop, shortuptarget)
VALUES
    (1, ’10’, 0, ‘0’, ’15’, 0, ‘0’, ‘0’, ‘0’, 0, 0, ‘IBM’, ‘0’, ‘0’, ‘1’, 0, ‘0’, ‘1.5’, 0, ‘0’, ‘0’, ‘0’, 0, 0, ‘AAPL’, ‘0’, ‘0’)

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Trading Demo of Automatically applying stop loss to new open positions

Trading Demo of Automatically applying stop loss to new open positions

This is visually good to see as I build this

Join my FREE mewsletter as I build this new internal trading system

 

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

How to apply psychology of trading when you put your positions on? CRITICAL reason to automate while retail traders WILL always lose money

How to apply psychology of trading when you put your positions on? CRITICAL reason to automate while retail traders WILL always lose money

Sorry if there are any typos here. Note that there is a video below as well

To succeed at life and risk management, you need to trade in a non human way. OTW automate your trades!!

Use average true range (ATR) to apply stop loss between a long and short. You set stop loss a 1:3 ratio as a soft target for the life a trade. You analyze the volatility when to apply the stop loss as part of the soft target. You are applying risk management and look at the reward over the risk. You can the calculate your capital deployment and strategize the situation when trade becomes winning or losing.

1. Set up risk reward on your new spread position.

2. There are various scenarios that need to be applied in certain outcomes.

You need to set hard stop losses and soft targets. This is done using ATR. The stop loss needs to be wide enough on the spread to profit over the trading horizon you choose. They also need to be NOT wide enough killed on discipline. No rule book applies here. You need to look at historical volatility of the time horizon you choose.

From there, you should be able to work out a sensible stop loss. It is over the time period you choose. As said, you choose a soft target on a 1:3 ratio of your stop loss. If you have a market price of $100, stop loss of $90 (exit trade to trade out automatically) the stop loss is 10%. This will also become your hard target but this is incorrect as you could keep trading for extra profit if that hard target is reached. Stop losses will guarantee your down side, if you set a soft target you are not guaranteeing your upside. You are taking on more risk but could even be adding more that position.

During your spread trade, you want to know the history of the spread. You would even want to see how the long and the short may perform against the ISM PMI as a comparative benchmark. You also would want to calculate monthly volatility. With a long and short, you will intend to cancel out the volatility to hedge out market and sector risk. With implied volatility calculate, you will isolate if both long and short are in the same sector. As a result, you remove market and sector volatility. With no news sentiment with no market impact, you could find your long may move up 1% vs the short may move up 1.5% which cancels out the price movement and volatility on a normal day. If the market goes up + or – 1%, the long and short should move in the same direction which means you will cancel the volatility.

Get the OHLC of each asset for 10 months historical, you will see an volatility over this period of potentially 1-3 months for the trade horizon. Calculate the 9 monthly ATRs each. You can then get the average of those for the 10th month. This will be applied from a rolling ATR of each 9 months. You can use this 10th month average ATR to calculate your disciplined stop loss. If you reach the target, you could be knocked out of the market if the stop loss is reached, but you are still applying discipline on the trade. You could apply positive price action and positive technical analysis here as well if all checks out with previous rules mentioned. You could apply a sensible stop loss in the range of each calculated long 10th month ATR and short 10 month ATR.

 

So if you current spread is 4%, you calculate your stop loss (10%) ratio with the current spread could =4*.10=0.4. Your new stop loss target could be =4-0.4=-3.6. Using a 3:1 target, that would become 3*3.6=.108.Your new soft target price will be 4+0.108=4.108. You will be able to see in a historical price chart that it has hit that price before which means it is realistic. If you use a long term trend line, you may see the current price may hit your soft target price. On another historical price chart, it would be recommended to draw different colored lines to show the soft target price and stop loss. You will visually be able to see the risk/reward play . One line would show you would be knocked out if the stop loss is reached. It is critical for the TRUE spread to work, you get stopped out of BOTH long and short not either. You trade both on at the same time, and you stop both at the same time. You are putting automatic stop losses on single positions. For most brokerage, you cannot apply the ratio of each spread. Again, do not apply stop losses on single positions for either long or short. They both need to be applied at the same time on the entry and exits. If done manually, you may need to cross check both your spread sheet on these as well as check your broker trading account to ensure these spreadsare within the correct soft targets. Or you could automate this process!! If these soft targets are reached, you may need to trade out manually if no automation is applied.

IMPORTANT FOR RETAIL TRADERS:

This enables you now to trade like a non human which is a long term failure for most retail traders. You will lose money otherwise over the long run. If you are losing on a trade, you need to follow the above process! You will always have winners in your portfolio so don’t worry if some of these will move against you. This will set you apart from the bad traders since you will have a proper framework, you do the correct thing with the losers and winners. If you do the opposite to be human, you will lose money over the long run by seeking more risk when a trade goes against you or with you, you are trading out at the proper target levels you establish with the process listed above. This process is the opposite of human which means long term profit. We don’t worry about trades that go wrong. This is why automated trading is critical to remove all the manual processes trade above. Stick with the habits of above, you WILL make money in the long run.

 

REASONS TO SET SOFT TARGETS and HARD STOP LOSSES THANKS TO AUTOMATED TRADING

If current spread is 4, $10k deployed for long and another $10k deployed for short. If your long out performs your short by 25% in 3 months, you may not want to trade out. You can run the position or apply more capital (or even margin), you could add to the wining trade. If there is $20K in the position, you could use the soft target with the above example. Your new stop loss could be 90% of the soft target where you roll the stop loss ratio. You want your new entry price to be below the new stop loss price. On a rolling basis (only generated automatically), your average price is comfortably under your stop loss. You are now getting free trades which means your stop loss will be above the average price. Your winning trde becomes a free situation. Your stop loss is above the average price which means if you are stopped out, you are still profiting. Even if the trade goes against you, you will still profit no matter what. Don’t do the opposite by trading out of the soft target and watch it go up during a rally. Humans could do that inadvertently when the market is presenting you a winner.

As result, you need to ensure your stop loss is wide enough to profit over the time horizon you choose. FOr mid and large cap situations on all major US and European indices, the stop loss ratio will be between 7-12%. This when you analyze your ATR over 3 month time horizon. The soft targets of 1:3 will be between 21-36%. As a result, you need to understand these parameters in future positions you will take. This will help you understand the risk/rewards on your positions and to play within those scenarios. Remember you still need to add the proper spread trading idea and screen process before applying the above.

If you use this process, you will get rid of the losing trades and constantly add new winning trades by following the right idea generation and screening process. If automated, you will never notice the guilt in getting rid of the losers. Over time you will be add more positive and circumventing the larger losses.

JOIN MY NEWSLETTER TO LEARN MORE LONG TERM PROFITABLE TECHNIQES LIKE THIS

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Interactive Brokers webinars on Single Stock Options and Hedge Risk and Trade Spot FX Forex Positions

Interactive Brokers
   Play
We think you’d like…

How To Trade The 15 Minute Chart Successfully with Pric…
by Forex Reviews
9,744 views

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Orders and positions hardest part done for this quant automated trading system with Interactive Brokers TWS

Orders and positions hardest part done for this quant automated trading system with Interactive Brokers TWS

This is the hardest step to building this platform

Join my newsletter to learn more about this system

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!

Lesson learned: tracking orders and positions is most complicated for automated trading platforms or HFT

Lesson learned: tracking orders and positions is most complicated for automated trading platforms or HFT

Learn how I plan to implement this challenge with my FREE newsletter

HOW DO YOU START A PROFITABLE TRADING BUSINESS? Read more NOW >>>

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!