Profit & Loss Slide Scale -- 2

Job ID: 34865366

Budget: $250 – $750 USD

I need help coding an algorithm or syntax to commit myself to abide by the rules. I need to manage and limit the amount that I am allowed to trade and lose per day. The ThinkorSwim Api is connected to Visual Studio Code.
Are you available to work with me on this project per hour or at a fixed price?

Note: 95 % of coding is already developed, I just need help on the risk management constraints or if statement

Level I:
On level I, the maximum share amount that I can buy is 500 shares and the maximum that I am allowed to lose is $100 dollars(500 x 20 cents = $100).

Level II:
On level II the maximum share amount that I can buy is 1000 shares and the maximum that I am allowed to lose is $200 dollars(1000 x 20 cents = $200).

Max Loss per Day Level I $300 & Level II $600? Depending on the level, only if you are making profit but the algorithm will not allow you to lose the capital of $300 and $600, you can risk profit but not the capital.

For example, if I trade 500 shares x 0.20 cents = $100.00 and I made a $100 profit, the trail stop will go to breakeven after a profit of $100 in case the trend reverse, so if the trend continue, the trail stop will be adjusting and synchronizing according the settings and it will takes out trading capital out the trade. Once the profit is above 200, sell 50% and move the trail stop to the 100 level and it will be adjusted on slide scale profitability until the trend ends or I've ended.

Before I take a decision, please write an overview of that you understood about the project & Scope, then I need you to remote my computer via AnyDesk to discuss a final details about the project.

PROJECT KEY : Write an if statement where user must be abide the rule rules otherwise will restrict or block you from trading.