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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      558 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      324 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      545 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      547 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X