JoshuaMcGowan

Strategy Test - Cancel Limit Order and Position Sizing

JoshuaMcGowan Telah dikemas kini   
While working thru another project had the need to troubleshoot the canceling of a limit order syntax/process as well as work thru the code and logic to automagically set the position sizing based off two user inputs (Amount to Risk in USD and Leverage to Use) and the potential entry and stop levels for an inside bar candle pattern in this scenario. Once we find the distance between the entry and stop level we can figure out the stop percentage amount which matches up with what a user would see manually drawing using the long or short tool in tradingview. Once we have the user inputs and levels we can get an amount to be used in later qty= type of places in zeeee pine script....
Nota Keluaran:
The previous code didn't meet my specific trade setup requirements but left that information commented out in case it applies and is helpful to someone else down the road. Will be testing this new approach and see how it ends up going. This is by no means a finished product but the various code snippets should be of help to others looking for ways to approach this risk management question.

All the best. #PMAFTW

Learn: www.therationalinvestor.com/?discount=Fok7MHYJDi5JHvZD6A4MHej
Connect: www.linkedin.com/in/thejoshuamcg/
Support via BTC: 38fNVWomAePgeoMCBfeJmdivbdk14LZQNx
Skrip sumber terbuka

Dalam semangat TradingView yang sebenar, penulis skrip ini telah menerbitkannya dengan menggunakan sumber terbuka supaya pedagang-pedagang dapat memahami dan mengesahkannya. Sorakan kepada penulis! Anda dapat menggunakannya secara percuma tetapi penggunaan semula kod ini dalam penerbitan adalah dikawalselia oleh Peraturan Dalaman. Anda boleh menyukainya untuk menggunakannya pada carta.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Ingin menggunakan skrip ini pada carta?