Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hosted Script with AddDataSeries()

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

  • Julio
    replied
    Hello Patrick,
    Yes, problem solved. The documentation is clear about it.
    Thanks!

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello Julio,

    Thank you for your post.

    You would use myIndicatorName.Update() in the strategy to force the indicator update. For example:
    Code:
    SMA(14).Update();
    For information on Update() please visit the following link: https://ninjatrader.com/support/help...-us/update.htm

    Please let me know if you have any questions.

    Leave a comment:


  • Julio
    started a topic Hosted Script with AddDataSeries()

    Hosted Script with AddDataSeries()

    Hello All,
    I use an indicator hosted in a Stretegy. The scheme is as follows:
    -The indicator has 10 AddDataSerires() based on 15 minutes, calculated on bar close. The indicator calculates some parameters from the prices of these 10 series regardless of the Primary (BarsArray[0]) Instrument. This works fine, whenever I load this indicator on a chart produces the expected output.
    -The strategy works at much higher frequency, calculated on each tick from 1 minute bars, and needs some variables from the indicator above as they become accesible. However, the strategy does not need the 10 dataseries at all, but following the Hosted recommendation of the documentation, I added them too.

    The weird thing is (Debugged with VS):
    When I load the Strategy on Strategy Analyzer, this is what happens:
    1) Strategy State.Configure is hitted
    2) Strategy State.DataLoaded is hitted
    3) Indicator State.Configure is hitted
    4) Indicator State.DataLoaded is hitted
    5) Strategy OnBarUpdate is executed for all the ticks and never produces any entry. this is because the indicator never computed anything since its OnBarUpdate Method never was called
    6) When Strategy ends, the indicator starts to compute its bars, inside OnBarUpdate but it is too late because The strategy has already ended.

    What I would like is to have step 5) and 6) in parallel. I can achieve this if I change the referenced Indicator. If the Strategy used for example another indicator that does not call AddDataSerires(), then I can see step 5) and 6) in parallel

    Of course 1 solution would be writting the Indicator's code in the Strategy but I would like to solve it in another way.
    Thanks in advance!

Latest Posts

Collapse

Topics Statistics Last Post
Started by dr0832, Today, 07:02 PM
0 responses
1 view
0 likes
Last Post dr0832
by dr0832
 
Started by mlurskint8, Today, 05:27 PM
3 responses
15 views
0 likes
Last Post NinjaTrader_ShawnB  
Started by SteveTheCPA, Today, 04:54 PM
0 responses
5 views
0 likes
Last Post SteveTheCPA  
Started by Unsuitable, Today, 02:42 PM
2 responses
9 views
0 likes
Last Post Unsuitable  
Started by ralett, Today, 11:52 AM
4 responses
24 views
0 likes
Last Post ralett
by ralett
 
Working...
X