BlueCollarDayTrading Posted July 29, 2017 Report Share Posted July 29, 2017 I was wondering if your paintbars can be written using switch, variable, plot Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted July 29, 2017 Report Share Posted July 29, 2017 The paintbars (well, Advanced paintbars) are C# code. So any syntax that C# allows can be used. Don't know what you mean by "plot" - we have the function SetYValue (it is documented in Help) with an example here: https://www.medvedtrader.com/trader/WebHelp/advanced___enhancing_an_indica.htm?zoom_highlightsub=SetYValue Quote Link to comment Share on other sites More sharing options...
BlueCollarDayTrading Posted August 2, 2017 Author Report Share Posted August 2, 2017 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 Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted August 3, 2017 Report Share Posted August 3, 2017 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? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.