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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        88 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        134 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        68 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        119 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        69 views
        0 likes
        Last Post PaulMohn  
        Working...
        X