Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BuyStop orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    BuyStop orders

    Hello,

    What can I do to get the program to stop trying to place buy stop orders below the market; which is causing my program to disable itself?
    Attached Files

    #2
    Hi AdeptistJune, thanks for posting. The strategy is trying to place the buy stop order either too close to the market price and the price changes before the order is submitted or the original price is below the market. You will need to compare the price you are setting the order at to GetCurrentAsk() to make sure the price is above the ask or place the order further away from the market price (from the ask price).

    Kind regards,
    -ChrisL

    Comment


      #3
      Hello Chris,

      How would I compare the price I'm setting the order at to GetCurrentAsk()?

      if(price > GetCurrnetAsk())
      {
      EnterLongStopMarket();
      }
      Last edited by AdeptistJune; 05-12-2022, 09:18 PM.

      Comment


        #4
        Hi AdeptistJune, It depends on how your strategy is set up and how you are calling the order, but it would be similar to this:
        Code:
        if(High[0]+TickSize*5 > GetCurrentAsk())
        EnterLongStopMarket(High[0]+TickSize*5);

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        67 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        202 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        366 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        284 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X