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

ARGUMENT MISSING NEAR - Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
recordz
Posted : Monday, August 6, 2012 2:53:32 PM
Platinum Customer Platinum Customer

Joined: 11/17/2005
Posts: 36

Hello there

(MAXHXAVGC3.3 + MINLXAVGC3.3 - MAXHXAVGC7.5 - MINLXAVGC7.5) / 2

 

It's just a histogram.  What's wrong with this fomula?  I'm getting Argument missing near -

 

I know you know, 

Thanks in advance,

recordz

 

Bruce_L
Posted : Monday, August 6, 2012 3:00:40 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I'm not sure if you mean the highest 3-Period Exponential Moving Average of the Close over the most recent 3-bars plus the lowest Exponential Moving Average of the Close over the most recent 3-bars minus the highest 7-Period Exponential Moving Average of the Close over the most recent 5-bars minus the lowest 7-Period Exponential Moving Average of the Close over the most recent 5-bars all divided by 2:

(MAX(XAVGC3,3) + MIN(XAVGC3,3) - MAX(XAVGC7,5) - MIN(XAVGC7,5)) / 2

Or the 3-Period Exponential Moving Average of the High from 3-bars ago plus the 3-Period Exponential Moving Average of the Low from 3-bars ago minus the 7-Period Exponential Moving Average of the High from 5-bars ago minus the 7-Period Exponential Moving Average of the Low from 5-bars ago all divided by 2:

(XAVGH3.3 + XAVGL3.3 - XAVGH7.5 - XAVGL7.5) / 2

Or something else entirely.

PCF Formula Descriptions
Handy PCF example formulas to help you learn the syntax of PCFs!



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
recordz
Posted : Monday, August 6, 2012 3:23:44 PM
Platinum Customer Platinum Customer

Joined: 11/17/2005
Posts: 36

Since I'm dealing with displaced moving averages, the former should be correct?????Now, the mistake appears to be a missing ")" at the end.  Also, does it matter if we use a comma or a period?  Is there a difference?  XAVG3,3 or XAVG3.3?

Bruce_L
Posted : Monday, August 6, 2012 3:31:43 PM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

I've tested the formulas I provided and they both work without any error messages at all.

Yes, it makes a difference if you use commas or periods.

Commas separate the arguments in functions. Periods separate the arguments in indicators.

MAX() and MIN() are functions.

XAVGH3.3 and XAVGL3.3 are indicators.

The first formula does not displace the moving averages at all.

The second formula is looking at the values of the moving averages from either three or five bars ago.

Can you provide an English language description of what you are attempting?



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
recordz
Posted : Monday, August 6, 2012 6:09:08 PM
Platinum Customer Platinum Customer

Joined: 11/17/2005
Posts: 36

Hello there,

Let's go back to square one.

I want to plot a 3 X 3ema displaced moving average.

Also, a 7 X 5ema displaced moving average

(two separate indicators on the same pane.)

Then I want a histogram of the two.

Somewhere I got the idea that the formula was XAVGC3.3 (for the 3 X 3) and XAVGC7.5 (for the 7 X 5).

Please set the record straight.

thanks,

recordz

Bruce_L
Posted : Tuesday, August 7, 2012 8:24:19 AM


Worden Trainer

Joined: 10/7/2004
Posts: 65,138

XAVGC3.3 is a 3 x 3 Displaced Exponential Moving Average assuming you mean a 3-Period Exponential Moving Average of the Close which has been shifted to the right by three bars (because the .3 at the end represents 3-bars ago).

XAVGC7.5 is a 7 x 5 Displaced Exponential Moving Average assuming you mean a 7-Period Exponential Moving Average of the Close which has been shifted to the right be three bars (because the .5 at the end represents 5-bars ago).

Your original syntax is invalid and ambiguous. I cannot tell your intent from your formula or your further clarifications. My Monday, August 06, 2012 3:00:40 PM ET post has detailed English language descriptions of both of my interpretations of your original formula. Both formulas would result in histograms.

If one of those interpretations is what you want, then you can just use the appropriate formula. If neither interpretation is correct, we would need to have further details as to your intent to help you create a working formula for what you want.

For example, your Monday, August 06, 2012 6:09:08 PM ET post does not mention minimums, maximums, highs or lows. All four concepts are referenced in your original formula, but if you just want a histogram of the two moving averages your formula would probably just be:

XAVGC3.3 - XAVGC7.5



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
kniss1
Posted : Tuesday, July 30, 2013 7:52:27 PM
Registered User
Joined: 3/29/2011
Posts: 3

Bruce I am trying to input code for a scan looking for a "J hook" pattern.  I have received the code from another trader. I have tried but can not find the error.I get the message   Argument missing near-       here is the formula:

MAXC10.1 > MINC10.10 * 1.1 AND MAXC 10.1/MINC 10. I < MAXC 10.6/MINC 10.6 AND C>C1 AND (MINC3 < MAXC7.3) OR (MINC3.1 < MAXC7.3) OR (MINC3.2 < MAXC7.3) OR (MINC3.3 < MAXC7.3) OR (MINC3.4 < MAXC7.3) OR (MINC3.5 < MAXC7.3) OR (MINC3.6 < MAXC7.3) OR (MINC3.7 < MAXC7.3) OR (ABS (C-AVGC10) / C < 0.01) OR (C1 < C2 AND C2<=C3)OR (C2< C3 AND C3 <= C4) OR (C3 < C4 AND C4 <= C5) OR (C4 < C5 AND C5 <= C6) OR (C5 < C6 AND C6 <= C7) OR (C6 < C7 AND C7 <= C8) OR (C7 < C8 AND C8 <= C9) OR (C1<=C2 AND C2 (AVGI-I3.8) AND (AVGH3.8) > (AVGH3.13) AND (AVGH3.13) > (AVGH3.18))                            Where I think the error is I have tried to change it but I still get the same message.                                                                                                Thank you                                                                                                                      

StockGuy
Posted : Wednesday, July 31, 2013 9:44:41 AM

Administration

Joined: 9/30/2004
Posts: 9,187

The bold section below, C2 (AVGI-I3.8), is the problem, but I don't know what it's supposed to be.  I can't make any sense of it.

MAXC10.1 > MINC10.10 * 1.1 AND MAXC10.1/MINC10. I < MAXC10.6/MINC10.6 AND C>C1 AND (MINC3 < MAXC7.3) OR (MINC3.1 < MAXC7.3) OR (MINC3.2 < MAXC7.3) OR (MINC3.3 < MAXC7.3) OR (MINC3.4 < MAXC7.3) OR (MINC3.5 < MAXC7.3) OR (MINC3.6 < MAXC7.3) OR (MINC3.7 < MAXC7.3) OR (ABS (C-AVGC10) / C < 0.01) OR (C1 < C2 AND C2<=C3)OR (C2< C3 AND C3 <= C4) OR (C3 < C4 AND C4 <= C5) OR (C4 < C5 AND C5 <= C6) OR (C5 < C6 AND C6 <= C7) OR (C6 < C7 AND C7 <= C8) OR (C7 < C8 AND C8 <= C9) OR (C1<=C2 AND C2 (AVGI-I3.8) AND (AVGH3.8) > (AVGH3.13) AND (AVGH3.13) > (AVGH3.18))

kniss1
Posted : Wednesday, July 31, 2013 10:52:06 AM
Registered User
Joined: 3/29/2011
Posts: 3

Thank you Stockguy, after your respond and a good night's sleep the problem was in the conversion from a PDF to a Word document (so I can copy and paste). In the conversion it has made a few errors and when you pointed out the part that did not make sense I went through the formula line by line and found a few errors in conversion. It works fine now. Once again, Thank you.

StockGuy
Posted : Thursday, August 1, 2013 10:46:22 AM

Administration

Joined: 9/30/2004
Posts: 9,187

Great!  Thanks for the follow-up.

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.