Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
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 for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I'm trying to put up or down arrows on the chart if certain conditions are met. Here's the code that I'm having trouble with:
plot Arrow = if (ConnersRSI <= UnderSold) then Arrow = (Arrow.SetPaintingStrategy(PaintingStrategy.ARROW_UP)) else if (ConnersRSI => OverBought) then Arrow = (Arrow.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN));
Think Script just gives me Invalid Statement. I took the form of the if statement right out of the TOS reference area.
Can anybody help get? Again, thanks in advance for the help.
AFAIK, you'll want to use addOrder() to add up/down arrows. But first a bit on your question about the invalid statement. When using plot Data = x, the x needs to resolve to a numeric value otherwise we couldn't plot it. For a very simplistic possibly even silly illustration, if we wanted to plot a 1 every time the close exceeded the open price and 0 if it didn't, we could write:
Note how the value assigned to Data is numeric (1 or 0);
Now for for putting arrows on the chart, the AddOrder() function offers that. The ConnorsRSI isn't built into TOS so I found an implementation online and modified it for use as a strategy and not a plot. We use the appropriate AddOrders with conditions for overbought buy and sell. I created this as a strategy (not a study) and then ran a strategy report on FB for the last year (daily) and it made 115 orders with total Profit/Loss of $2075. I also used the standard convention from other strategies where up arrows indicate a long entry (aka buy) and down arrows a short entry (aka sell). Hope that helps
jeremyis already gave you a great reply, way above my pay grade. But for those browsing who are more TS newbie than I am, the thread title suggests something simpler might be on offer. So here are some simplistic answers to your question.
--------------------------------------