Jump to content

Recommended Posts

ok C# it is

I am trying to get all of my Paintbars moved from my Thinkorswim platform to Medved Trader

Trying to figure out how to have a rule that a Candle closes in the top 25% on a green candle and the inverse closes in the bottom 25% of a red candle

Close >= High - ((High-Low) * .25) works in Thinkorswim, no luck getting it in C# yet

any help is appreciated

I haven't programmed since C++ in college 20 years ago

Share this post


Link to post
Share on other sites
Mike Medved    30

C# is not C++ (though some of the syntax is similar)

First, saying "top 25% of a candle" is ambiguous. Is the range of the candle High-Low or the absolute value of (Open-Close)?

But if you take it as High-Low then:

"Candle closes in the top 25% on a green candle condition" would be

(Close >= High - (High-Low)*.25) && (Open<Close)

the inverse of course would be

(Close<=Low+(High-Low)*.25) && (Open>Close)

also note that the scan runs on the last candle, which may NOT have completed yet. If you want to run it on completed full candle, you should run it on the previous candle to the last one. Which means all values should have [1] index. Like this:

(Close[1] >= High[1] - (High[1]-Low[1])*.25) && (Open[1]<Close[1])

How exactly are you entering it (I presume as an Advanced scan) that it doesn't work?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×