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)
You helped me get the indicator working great, been using it for a few weeks now with success. Now I'm attempting an automated entry.
Here is my generic code for the purpose of illustration.
For some reason even though I am saying only "Up", as you can see it is entering on the "Down" indication as well. Any insight would be appreciated. Also, I have to use the indicator on COBC true because it doesn't work quite right with it on false. Probably a separate issue but just throwing all my delimas out there. Thank you to anyone in advanced.
The reason because COBC false doesn't work quite well for you is probably because the values of the indicators change intrabar (ie: during a bar creation you can have: Up, Down, Up, Down, etc.).
As to your main problem in your condition you compare TMLUp[1] and TMLUp[0], but what are the values of TMLUp - Is it possible that the line will be colored down even though [0] is greater than [1]?
I would recommend adding some Print statements eg.
for all the values so you could check if the condition is what you expect.
Print will print the message you want into the output window. You can open Output Window from Control Center (Tools) or from NinjaScript code editor (4th icon from the left on the toolbar)
Your TMLUp and TMLDown seem to be nothing else than just a reference to the same LinReg. If your goal for TMLUp and TMLDown is to only represent binary result (it is either Up or Down, 1 or -1) then you need one additional dataseries TML and temp int, eg.: private int tempTML = 0;
Then in your code just as you did with color:
In your strategy you can then ask for:
As already mentioned before remove the {} that are not following a method, condition or property details - this is really bad habit and makes the code unreadable - there is no benefit and high cost to using them.