Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Set profit target on bid/ask

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

    Set profit target on bid/ask

    Hi,

    I would like to set profit target on Bid/Ask().
    The following pseudo code might help

    if(order is Buy) Then
    SetProfitTarget(CalculationMode.Ticks, 12, Bid)

    if(order is Sell) Then
    SetProfitTarget(CalculationMode.Ticks, 12, Ask)





    #2
    Hello bosajin,

    Thank you for the post.

    What part of this did you need help with specifically? Are you asking how to get the prices for the bid and ask or how to form the condition to find the type of order?

    I look forward to being of further assistance.

    Comment


      #3
      I want to close the order on bid price not on ask price.
      Actually when I take long position and set profit on 12 tick then order will be closed as soon as price get to Ask price but I want to close it when price get to Bid price.

      Comment


        #4
        Hello bosajin,

        From the added details I am not certain what part you need help with. You have described what you want to do but not what you need help with or what you are having trouble with in your code.

        Are you asking how to get prices? You can use GetCurrentAsk or GetCurrentBid to get the ask/bid prices:




        If you want to change the stop from 12 ticks away to a set price you would need to use OnBarUpdate to change its price, is that what part you are asking for help with?


        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        63 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        139 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        75 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        45 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        50 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X