Comparison on ThinkorSwim

Discussion in 'Strategy Building' started by trader_knight, Sep 13, 2020.

  1. hi everyone, is there a way that the instrument set as a comparison on the chart can be access in thinkscript so I can code pivot "Peaks/Valleys" on it. I attach a screenshot of how my chart looks with my main instrument & a comparison instrument.

    appreciate the help, Ty!
     
  2. Just make a new study and put this in the source code.
    Code:
    input symbol = "/ES";
    plot cmp = close(symbol);
    Then you can do anything you want to the data series using thinkScript.
     
    Last edited: Sep 13, 2020
    .sigma and TimtheEnchanter like this.
  3. check out my screenshot, when I right click on edit studies it only display to view properties, view sources, Duplicate

    when I click on duplicate it, it brought the source file on the screenshot which said: # Source code isn't available.

    which i'm guessing that this code provide isn't sufficient by its comment of them not providing the whole code needed or am I approaching it wrong?

    appreciate the help!
     
    Last edited: Sep 13, 2020
  4. AFAIK, the problem is with the ability to choose candles, bar, or line.

    The comparison study can do this, but I don't know how to make a new comparison study that will allow you to specify those attributes for another data series using the plot command. I don't think you can. You can still choose different styles for the plot with the code I provided, but not the same ones as the restricted access source code comparison study TD made.
     
  5. I'm having difficulty in deciphering a specific question! It seems you may be asking multiple questions, which make it impossible to resolve when you don't understand Thinkscript enough to ask unambiguous questions.
    1) Form your attempt to "duplicate" the proprietary study, I am GUESSING you wish to Modify that study to include your own code as well! Since the code is proprietary, either you will need to "reverse engineer it" (or have someone else reverse engineer it) allowing you to have a base with that functionality that you can then modify as you desire!! --
    2) You also seem to be desiring to compare different symbols with a relative difference for some reason.
    3) You also seem to be desiring to code some pivot points on something (perhaps relating to some to the symbols you plan to compare)?
    Too many uncertainties to derive a specific question. I an not good at guessing what the question should be from people I am not yet familiar with!

    My guess is you likely can accomplish anything you are desiring, but I need something less nebulous to provide assistance.
    Note: Even if you need to go down #1 above, it is very likely someone has already reverse engineered it, especially with the "comparison" function winch is fairly trivial and not proprietary!
     
  6. stepandfetchit, thanks for the reply!

    *Objective* you can say that I would like be allow to draw anything like pivots, arrows, etc
    for the secondary instrument overlapping the first one, so it can be access in code so we can plot stuff on the secondary as well.

    hope that this is more clearly stated
     
  7. I don't know what you mean by "overlapping the first one ..."! If you want primary, then do the primary! If you want the secondary, then do the secondary! If you want both, then do both!
    Perhaps your question should be "how do I select the secondary instead of the primary" -- or something similar? -- look at the detail on "Fundamentals" Functions! Note that the default symbol is the primary, so if you want something other than the primary, you merely need to specify that! For example: close {the close of the primary} VS close(Symb0l="USD/JPY")
    Below is example using you post from above, but merely adding two lines to it!


    upload_2020-9-13_16-22-14.png
     
  8. It did not work, it only draws a line. The screenshot provided is my desire result. Which is what I mean by overlapping. After that

    *Objective* you can say that I would like be allow to draw anything like pivots, arrows, etc for the secondary instrument overlapping the first one, so it can be access in code so we can plot stuff on the secondary as well.
     
  9. You will need to figure out what you want, then do it! Or convey what you want and have someone do it for you! I have no interest in trying to determine what you should have asked!
    Good luck.

    Note: your screen shot fails to disclose what you are trying to plot as the primary symbol. I have given up guessing at the information you are failing to disclose!
     
  10. Everything is being convey orderly & specific to the point, and yes thanks for your help because no one is paying you for this,

    1. My screenshot deduces my idea that I do not want to have multiple instruments on unique charts separately, and that I want at least two instruments to be on the same chart window, hint overlapping just like the comparison tool allows.

    2. That being said, I'm trying to have is both instruments having primary privilege to have pivots plotted on them in code.
     
    #10     Sep 13, 2020