Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Profile: jztrader
About
User Name: jztrader
Groups: Member, Platinum User, TeleChart
Rank: Registered User
Real Name:
Location
Occupation:
Interests:
Gender: Gender:
Statistics
Joined: Sunday, December 4, 2016
Last Visit: Wednesday, February 20, 2019 10:25:17 PM
Number of Posts: 5
[0.00% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Referencing and existing PCF
Posted: Thursday, January 3, 2019 5:38:51 PM

Bruce,

I wanted to follow up and clarify what I am looking specifically for. 

The COUNTTRUE formula in my last post results in creating an oscillator with both positive and negative numbers.  That's the reason I have some of the COUNTTRUE statements starting with a -1 which produces a negative number which is what I want.  It may not be the ideal way to write the formula but it does work. 

What I am really looking for with this formula is the diffence between the current bars formula value versus the value from yesterday (or from 1 min ago, 2 min. ago, whatever time frame being used). So as an example, if the current bars formula value is 4 and yesterday's formula value is 1 then it would return a value of 3 (4-1).  Seems like a simple subtraction but with many formulas, I was not sure how to write it.

Since the formula produces negative values, I am looking for both the real difference (like in the example) and how to get the ABSOLUTE difference which would just produce a positive number.  Hope this makes sense. 

Also, with another software, I created this formula but used an 8 period exponential moving average instead of a the counttrue function for 5 periods (simple not exponential). Is there a way to produce this overall formula using the "xavg" function for each statement within the overall formula? I prefer a more weighted formula (exponential) versus a simple formula. 

Thanks for your help in advance.

John

 

Topic: Referencing and existing PCF
Posted: Friday, December 7, 2018 3:01:35 PM

Good afternoon,

I have created a PCF that uses several COUNTTRUE functions together. 

Here is an example of part of the formula:

counttrue(c>c1 and h>h1 ad l>l1,5) + counttrue(c-o>=max(c-o,9),5) + -1*counttrue(c<c1 and h<h1 and l<l1,5) + -1*counttrue(o-c>=max(o-c,9),5)

I am attempting to create another PCF that will take the difference between today&#39;s value a yesterday&#39;s value. Could you provide me an example of how to do this?

Also, is there a way to reference an existing PCF in a new PCF without having to write the entire PCF out?

Thank you.  

Topic: Help with conditions returning values of +1, 0 or -1
Posted: Friday, November 23, 2018 1:45:03 PM

You were helping out Chris55 with some questions around having conditions return +1 and/or -1 values.  My question is similar. 

I understand that a Boolean condition will normally return +1 if true and 0 if not true.  How do you write a formula that would return a -1 if true and a 0 if not true? 

I have some bullish and bearish conditions that I want to combine in to an oscillator in histogram style so the +1 and -1 are necessary.  Currently all the formulas return +1 or 0 and so the indicator never goes in to negative territory. 

If conditions cannot return a -1 value, is it possible to have the boolean formula multiplied by -1?

Thank you.

 
Topic: moving average of a boolean condition/formula
Posted: Wednesday, November 21, 2018 4:28:52 PM

Thank you!

Topic: moving average of a boolean condition/formula
Posted: Tuesday, November 20, 2018 11:24:20 PM

If I wanted to create a moving aveage of a single condition or multiple conditions (below), how would I do it?

bbtop2.3>bbtop2.3.1 and bbbot2.3<bbbot2.3.1

Thank you.