• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 jeronymite, Today, 09:26 PM
        0 responses
        6 views
        0 likes
        Last Post jeronymite  
        Started by ttodua, Yesterday, 06:45 AM
        2 responses
        17 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by franco12364, Today, 08:08 PM
        2 responses
        11 views
        0 likes
        Last Post franco12364  
        Started by smcllr, Today, 06:10 PM
        1 response
        16 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by lupearadu, Today, 01:58 PM
        7 responses
        38 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X