Kasper Posted March 4, 2021 Report Share Posted March 4, 2021 (edited) Hello, Is DefinePaintbarParameter limited to numeric values only? Is it possible to accept String as parameter? I am trying to adds prices of 2 or more option symbols and plot a line using SetYValue of this net price for an option strategy. It is working fine except I cannot change symbol on PB parameter on chart. //Defined Vars to use CompareSymbol Any other way to do this? Edited March 4, 2021 by Kasper Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted March 5, 2021 Report Share Posted March 5, 2021 it is numeric only. Cannot use the string parameter to change the compare symbol. If this is for a Paintbar on a chart vs scan, then just define the Compare To Symbol indicator in the Paintbar and do NOT set the symbol parameters. Then, when you add the paintbar to the chart, make sure to also add the "Compare To Symbol" indicator. The Paintbar will take the definition of that indicator Quote Link to comment Share on other sites More sharing options...
Kasper Posted March 5, 2021 Author Report Share Posted March 5, 2021 I posted my code above but I guess code is not allowed. Plotting Compare Symbol is no problem, it works with or without paintbar. My goal is to track last prices of two symbols, add or substract them and plot a line in lower indicator window. It works fine for more liquid symbols but less accurate estimate when one or more symbol is illiquid. I would like to set alert when net price is closing in my target. There's no last/bid/ask price option for Compare Symbol, I use short time frame to simulate last price. Is it possible? If paintbar parameter could accept string then copying symbol will be easier, instead of updating in the paintbar and having to manage multiple paintbars. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted March 5, 2021 Report Share Posted March 5, 2021 you cannot reference bid/ask/last on the candles and indictors. Compare To just has one "Line" value, which is the close of the candle Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.