• 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

  • 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:


  • 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.

Latest Posts

Collapse

Topics Statistics Last Post
Started by ralett, 02-12-2020, 12:11 PM
2 responses
98 views
0 likes
Last Post trader333  
Started by GKRuubster, Today, 06:22 AM
0 responses
12 views
0 likes
Last Post GKRuubster  
Started by Gerik, Today, 05:59 AM
0 responses
8 views
0 likes
Last Post Gerik
by Gerik
 
Started by bosajin, Today, 05:43 AM
0 responses
7 views
0 likes
Last Post bosajin
by bosajin
 
Started by ALIENFX, Today, 02:05 AM
0 responses
9 views
0 likes
Last Post ALIENFX
by ALIENFX
 
Working...
X