Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

SetProfitTarget and get current time.

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

    SetProfitTarget and get current time.

    Hallo. Have two questions.
    1. What is the code representing realized profit. I would like to hold strategy (do not place orders) for e.g. for half hour if the realized profit will be bigger than for e.g. 200$ .

    2.How to save time of order place or exit to variable?? What is the code representing current time?

    Rgds Czarek
    Last edited by Czarek; 07-25-2009, 03:43 AM.

    #2
    Hello,

    What you can do with performance information is listed here:



    You will need to track the realized profit by recording the entry price, etc. I believe this will be included in NT7 though...

    I'm not sure I understand your second question. You can get the current time via:

    Get order information via:
    Last edited by NinjaTrader_Ben; 07-25-2009, 08:25 PM.
    DenNinjaTrader Customer Service

    Comment


      #3
      Hello Ben.
      I would like to hold strategy work (do not place any orders) for half hour when the strategy reach e.g 400$ realized profit or get stop loss. To do this, I would like to save ExitOrder time to variable then add 30 min (+1800) and let the strategy work again. The main problem is how to save the Exit time??

      Rgds
      Czarek.

      Comment


        #4
        Hello,

        You can get it by using DateTime.Now as seen in the second to last link I provided, or you can use IOrder and something like myorder.Time per the last link I provided below.
        DenNinjaTrader Customer Service

        Comment


          #5
          Hi,
          How should I create variable to save the execution time??
          I try to use myorder.Time or execution.Order.Time but in the way I can save AvgFillPrice
          I can't save Time.

          Comment


            #6
            Hello,

            You will want to use delcare it as DateTime. Try this to see what you are working with:

            DateTime timetester = DateTime.Now;
            Print(timetester);

            DenNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by geddyisodin, Today, 05:20 AM
            1 response
            11 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by Max238, Today, 01:28 AM
            3 responses
            32 views
            0 likes
            Last Post Max238
            by Max238
             
            Started by timko, Today, 06:45 AM
            2 responses
            13 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Started by habeebft, Today, 07:27 AM
            0 responses
            5 views
            0 likes
            Last Post habeebft  
            Started by Tim-c, Today, 03:54 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X