Jump to content
Medved Trader Forums

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...