Plot line has gaps/disconnected on intraday charts - futures io
futures io futures trading



Plot line has gaps/disconnected on intraday charts


Discussion in ThinkOrSwim

Updated by MrRobot
    1. trending_up 341 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 0 replies
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Thread Tools Search this Thread
 

Plot line has gaps/disconnected on intraday charts

  #1 (permalink)
Knoxville
 
 
Posts: 3 since Jul 2019
Thanks: 0 given, 0 received

Hello!
I have a study I'm working on to measure the term structure/contango of /VX futures -- I just want to compare the percent difference between the front month contract and next month contract price. I'm then plotting this line on an /ES price chart. This is the formula I'm using:

(close(nextContractVX) - close("/VX")) / ((close("/VX") + nextContractVX) / 2);

However when I try to plot this on intraday charts there's several large gaps in the plot line and I was wondering if anyone knew what would cause this.

Here's the script:

 
Code
def Month = GetMonth();
def Year = GetYear();
def Year_Ext = Year - 2000;
def agg = AggregationPeriod.ten_MIN;
def NextContract = if Month == 1
                   then Close(symbol = "/VXJ" + Year_Ext, period = agg)
                   else if Month == 2
                   then Close(symbol = "/VXK" + Year_Ext, period = agg)
                   else if Month == 3
                   then Close(symbol = "/VXM" + Year_Ext, period = agg)
                   else if Month == 4
                   then Close(symbol = "/VXN" + Year_Ext, period = agg)
                   else double.nan;
plot contangoPercent = SimpleMovingAvg((nextContract - close("/VX")) / ((close("/VX") + nextContract) / 2), 5, 0);
# plot contangoPercent = (nextContract - close("/VX")) / ((close("/VX") + nextContract) / 2);
Since it's currently April -- month 4 -- NextContract is close("/VXN20")

Thanks very much!



Last edited by MrRobot; April 3rd, 2020 at 11:57 AM.
Reply With Quote



futures io Trading Community Platforms and Indicators ThinkOrSwim > Plot line has gaps/disconnected on intraday charts




Upcoming Webinars and Events
 

Free BloodHound Licenses to everyone!

June
 

Every journal equals ten meals for the hungry

June
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts