Understanding AddOrder

I am trying to make a stop lost script.
But I don't understand some parameter. What is the price parameter mean
open[-1]
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Others/AddOrder

Also what is the difference between
OrderType.SELL_TO_CLOSE and
OrderType.SELL_AUTO

Also when I look at other stocks, look like script focus on the stock I look into my chart. If I create a stop lost script, how can I make it so I can look at other stocks without trigering a sell order on the stock I am looking, instead of the one I have a position on?
 
@CapitaineFlam88 The open[-1] index points to the next future bar... Positive numbers look back and negative numbers point forward... No index, or a zero index, refers to the current bar...

As for OrderType's, SELL_TO_CLOSE is self-explanatory in that it closes a long position but SELL_AUTO will either SELL_TO_CLOSE a long position or SELL_TO_OPEN for a short position... Essentially, AUTO plays in both market directions while specific OrderTypes only play in specific market directions...
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

How long and what is a Tick?

"Long" refers to buying rather than "Short Selling"...

A Tick is a measure of price movement, dependent upon the minimum movement a given symbol moves... Tick charts are based on price movement instead of being time-based...

As for your concern in your first post above, switching between chart symbols will not interfere with the backtesting strategy as the Strategy will calculate for each symbol displayed...

Now, don't take this the wrong way but I think you need to do some serious research before attempting to progress further with coding or trading... I say this because of the very basic questions you are asking that you should already know the answers to before attempting to trade or develop Studies or Strategies... Regardless of what trading style you may be using or considering, you need to know as much as possible so you don't jeopardize your trading account funds...
 
In backtesting, it is hard to see the long and short entry display words.

I've stripped as much out of what prints on the screen to see if it helps, but the entry (and exit) text is still buried under and within the candles.

Is there a way to make it more easy to see, perhaps with a bubble or arrow that's separated up higher from the candles for short entry, or lower than the candles for a long entry?
 
Last edited by a moderator:
In backtesting, it is hard to see the long and short entry display words.

I've stripped as much out of what prints on the screen to see if it helps, but the entry (and exit) text is still buried under and within the candles.

Is there a way to make it more easy to see, perhaps with a bubble or arrow that's separated up higher from the candles for short entry, or lower than the candles for a long entry?

The ToS platform provides us limited plot options with AddOrder parameters.
You seem to have utilized most of them.

The ToS platform defines whether the AddOrder bubble should be displayed above the price location or below utilizing the UP parameter.
Perhaps that would help:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Look---Feel/AddChartBubble
 
Last edited:
In backtesting, it is hard to see the long and short entry display words.

One thing you can try is to turn down the Transparency of the candles.

Chart Settings (gear icon) > Appearance > click color boxes next to Border up / Border / Fill up / Fill Down > More... > HSV > Transparency (slide it down to 50%). You can also uncheck Fill up / Fill down to turn off the fill colors.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
310 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top