Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help mod indicator

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

    Help mod indicator

    Hi, i have a supertrend ive downloaded from one of the threads, i would like to make it lag, meaning recalculate 1 bar behind the open bar, like when its set to calculate on bar close, but working real-time.

    ive tried many times but gets broken no idea what im doing wrong, thanks very much in advance!

    The idea is to get the indicator to calculate on bar close, while the strategy calculates in realtime so it fills the orders realtime instead of waiting for the close of the candle
    Last edited by kabott; 10-06-2015, 07:49 AM.

    #2
    Hello kabott,

    Thanks for your post.

    A couple of alternatives are:

    1) Add a 1 tick data series to your strategy and run it CalculateOnBarClose = true with your strategy logic pointing to the 1 tick series while the indicator runs off the primary bars. This will give your strategy logic an OnBarUpdate for each tic to process the orders while pointing to the previous bar in the indicator.

    2) In your strategy, evaluate the indicator on bar index [1] instead of [0] (where 1 is the just completed bar and [0] is the bar forming, when CalculateOnbarClose = false.

    Comment


      #3
      Hi Paul, thanks for your response, i was going for the second alternative but the indicator seemed to brake every time, i tested several alternatives until it finally worked ok, now a new problem has emerged, i have this logic:

      //FALLING TREND
      if ( ( Close[1] < _superTrend.SPFlipper[1] )
      && ( Close[1] > _superTrend.SPCenterAverage[1] || Close[2] > _superTrend.SPCenterAverage[2] )
      && ( Close[3] > Open[3] && Close[2] > Open[2] && Close[1] < Open[1] && FirstTickOfBar ) )

      SELL

      With the intention once the conditions are met, the strategy should sell at the open of the second bearish renko bar

      Click image for larger version

Name:	2015-10-06_134748.jpg
Views:	1
Size:	7.6 KB
ID:	874890

      yet, it seems to be selling when ever it pleases, sometimes even at the third bearish bar

      EDIT: ok i think i fixed it now.
      Last edited by kabott; 10-06-2015, 11:29 AM.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      128 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      73 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      116 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      109 views
      1 like
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      88 views
      0 likes
      Last Post CarlTrading  
      Working...
      X