• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Can I access "Offset" and "Rollover date" from NinjaScript code?

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

  • Can I access "Offset" and "Rollover date" from NinjaScript code?

    I made XML file that contain historical supp \ res levels, like this:

    HTML Code:
    <levels instrument ="CL" tf="H1">
       <l beg="19.08.2014 19:00:00" pr="110.20" end="25.08.2014 20:00:00" tag="sup" />
       <l beg="19.09.2014 05:00:00" pr="110.30" end="30.08.2014 19:00:00" tag="res" />
       <l beg="23.09.2014 17:00:00" pr="105.01" end="03.09.2014 03:00:00" tag="sup" />
       <l beg="03.10.2014 18:00:00" pr="106.17" end="19.09.2014 05:00:00" tag="res" />
    </levels>
    And now I need to write indicatror that can parce XML and show levels on chart.

    I use Merge policy "MergeBackAdjusted" only.

    As for as I understand, after every expiration date chart jump up or down on (offset / TicksSize) ticks, but levels will plotted on fixed price (specified in XML file).


    The question: is there any way to access from indicator code "Offset" and "Rollover date" values to adjust levels prices after each expiration?
    Last edited by fx.practic; 11-02-2014, 12:43 PM.

  • fx.practic
    replied
    That's great, exactly what I need. Very comfortable realisation. Thank You!

    This work for me:


    if (Instrument.MasterInstrument.MergePolicy == MergePolicy.MergeBackAdjusted)
    level.price_to_plot = level.price_from_xml + Instrument.GetOffsetSum( level.begin_time );
    else
    level.price_to_plot = level.price_from_xml;
    Last edited by fx.practic; 11-04-2014, 03:12 PM.

    Leave a comment:


  • NinjaTrader_PatrickH
    replied
    Hello fx.practic,

    Thank you for your post.

    You can find an example at the following link: http://www.ninjatrader.com/support/f...d=4&linkid=558

    Leave a comment:

Latest Posts

Collapse

Topics Statistics Last Post
Started by pitifak, Today, 01:01 AM
0 responses
3 views
0 likes
Last Post pitifak
by pitifak
 
Started by rjafcv, Yesterday, 10:40 PM
0 responses
4 views
0 likes
Last Post rjafcv
by rjafcv
 
Started by JAtrades, Yesterday, 07:38 PM
0 responses
3 views
0 likes
Last Post JAtrades  
Started by bouncetherubble, Yesterday, 07:07 PM
0 responses
2 views
0 likes
Last Post bouncetherubble  
Started by bouncetherubble, Yesterday, 06:12 PM
0 responses
5 views
0 likes
Last Post bouncetherubble  
Working...
X