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.
    JesseNinjaTrader Customer Service

    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:

        https://ninjatrader.com/support/help...b=getcurrentas
        https://ninjatrader.com/support/help...=getcurrentbid

        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.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by averoos, Today, 03:51 PM
        0 responses
        3 views
        0 likes
        Last Post averoos
        by averoos
         
        Started by crazyhorse2393, Today, 03:31 PM
        2 responses
        6 views
        0 likes
        Last Post crazyhorse2393  
        Started by wooofad, Today, 02:56 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by jalley, Today, 02:29 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by dtl-saw, Today, 02:53 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X