Purchase a specific dollar value worth of a stock/equity

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #238923 quote
    JoshPhoenix
    Participant
    New

    Hey all,

     

    Is it possible to code an algo to purchase a specific $$ amount of a stock, vs hardcoding the number of shares?

    eg if a stock is trading at $500 and to want to purchase $2000 worth of it, the number of stocks would be 4. if a stock was trading at $250, it would be 8 shares.

    #238926 quote
    JS
    Participant
    Senior

    Hi,

    You can use the following:

    If BuyConditions then

    Buy 2000 Cash

    EndIf

    JoshPhoenix and Iván González thanked this post
    #238937 quote
    JoshPhoenix
    Participant
    New
    Great, thanks 🙂
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Purchase a specific dollar value worth of a stock/equity


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by JoshPhoenix
1 year, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/13/2024
Status: Active
Attachments: No files
Logo Logo
Loading...