Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Time Since Last Trade

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

    Time Since Last Trade

    How is it possible to implement a time on last trade.
    Eg: I want to enter a position. Then the time on that position is calculated. Then approximately 30 mins later, once the strategy conditions are met again, do another entry. Not before.

    Any Tips??

    #2
    jthom, you could store the trade entry time in a DateTime object and compare it then later for the second entry to take place, easier to implement would be counting the bars passed since the first entry.

    http://www.ninjatrader-support.com/H...inceEntry.html
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Ok say that Im using Renko 3 bars and ill use the barsince entry method:

      protectedoverridevoid OnBarUpdate()
      {
      if (Historical)
      return;
      if (CurrentBar < 20)
      return;

      // Condition set 1
      if (BarsSinceEntry() > 10
      && Open[0] > EOTVramBars(0.65, 1.3, true).VramUpConfirm[0]
      && orderId.Length == 0
      && atmStrategyId.Length ==
      0)


      {
      atmStrategyId = GetAtmStrategyUniqueId();
      orderId = GetAtmStrategyUniqueId();
      AtmStrategyCreate(Action.Buy, OrderType.Market,
      0, 0, TimeInForce.Day, orderId, "AtmStrategyTemplate", atmStrategyId);

      }


      Pretty much nothing happens. Im assuming this will only calculate after an entry has been made? which is <20 >10th bar since last entry?
      Is that right?

      Comment


        #4
        BarsSinceEntry() is not for ATM orders. It is for NinjaScript orders.
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by muratb35, Today, 03:36 AM
        0 responses
        4 views
        0 likes
        Last Post muratb35  
        Started by fernlicht, Today, 02:16 AM
        2 responses
        13 views
        0 likes
        Last Post fernlicht  
        Started by fernlicht, 04-12-2021, 06:01 PM
        1 response
        29 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by memonolog, Today, 02:10 AM
        3 responses
        10 views
        0 likes
        Last Post memonolog  
        Started by orenytz, Today, 12:25 AM
        0 responses
        10 views
        0 likes
        Last Post orenytz
        by orenytz
         
        Working...
        X