Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

A Simple Trading Method Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
Putt4Dough
Posted : Friday, October 21, 2016 9:30:01 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Happy Friday Bruce,

I know we can’t really backtest in TC2000 but since we can export chart data I’d like to take a stab at a simple algorithm using the available 500 bars of data.

For this one we’re using the daily timeframe exclusively. (I know, right?)

I’d like to plot the following Indicator PCF Formulas on the chart so I can export them:

  • The average close of the last 20 days
  • The average close of the last 20 days starting 3 days ago
  • Today’s close
  • The close 3 days ago
  • The close 3 + 20 days ago

I’d also like to plot the following Condition PCF Formulas on the chart (maybe as rows of green and red dots?) so I can both eyeball the chart to see when the conditions are true and also export their values:

Bullish

  • True if the average close of the last 20 days is greater than the average close of the last 20 days 3 days ago.
  • True if today’s close is less than the close 3 days ago.
  • True if today’s close is greater than the close 3 + 20 days ago.

Bearish

  • True if the average close of the last 20 days is less than the average close of the last 20 days 3 days ago.
  • True if today’s close is greater than the close 3 days ago.
  • True if today’s close is less than the close 3 + 20 days ago.


In other words, given that X = 20 and Y = 3, for buys:

  • The average close of the previous 20 days must be greater than the average close of the last 20 days starting 3 days ago.
  • Today’s closing price is less than the closing price 3 days ago.
  • Today’s close is greater than the close 23 days ago. 

Doable?

Bruce_L
Posted : Friday, October 21, 2016 9:45:37 AM


Worden Trainer

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

These are all pretty straightforward if I am understanding your post correctly.

Bullish:

AVGC20 > AVGC20.3 AND C < C3 AND C > C23

Bearish:

AVGC20 < AVGC20.3 AND C > C3 AND C < C23



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
Posted : Friday, October 21, 2016 10:07:54 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Yeah, keeping it simple this time. Actually just wanted to test something I read in a book about money management. Interestingly, over 90% of the book is money management - there's only one chapter on "systems" and you just coded it. I guess the author's point was that it isn't what you trade as much as how you trade it. We'll see. Wish I had more than 500 bars, but it's a start. :)

Thanks, Bruce ... enjoy your weekend!!

Before I forget - do you know what causes the &rsquo: thing? It doesn't show up in preview mode when I'm proofreading. I usually write longer posts in a text editor first, but I'm usually careful about using a plain old text file.

 

Bruce_L
Posted : Friday, October 21, 2016 10:22:57 AM


Worden Trainer

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

I think it might be caused by a bug in preview mode actually. What is happening is that it is displaying some of the HTML instead of interpreting the HTML (as if PerserveHTML is checked). I don't think it happens if you avoid using preview.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
Posted : Friday, October 21, 2016 10:32:56 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Thanks!!

Putt4Dough
Posted : Tuesday, October 25, 2016 9:23:54 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Good morning Bruce!

Okay, apparently one cup of coffee isn't enough...

I created eight Condition PCF Formulas:

  • AVGC20 > AVGC20.3
  • C < C3
  • C > C23
  • AVGC20 < AVGC20.3
  • C > C3
  • C < C23
  • AVGC20 > AVGC20.3 AND C < C3 AND C > C23
  • AVGC20 < AVGC20.3 AND C > C3 AND C < C23

I'd like to plot these as eight rows of dots, but I'm having a brain cramp. What's the technique again?

Bruce_L
Posted : Tuesday, October 25, 2016 9:51:06 AM


Worden Trainer

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

Maybe try adding using the following formulas as Custom PCF Indicators in the same pane and scale.

8 / ABS(AVGC20 > AVGC20.3)
7 / ABS(C < C3)
6 / ABS(C > C23)
5 / ABS(AVGC20 < AVGC20.3)
4 / ABS(C > C3)
3 / ABS(C < C23)
2 / ABS(AVGC20 > AVGC20.3 AND C < C3 AND C > C23)
1 / ABS(AVGC20 < AVGC20.3 AND C > C3 AND C < C23)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
Posted : Tuesday, October 25, 2016 9:55:09 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

The New button has Condition (PCF) Formulas and Indicator (PCF) Formulas ... how do I create Custom PCF Indicators? 

I should have really made an entire pot of coffee. :)

Putt4Dough
Posted : Tuesday, October 25, 2016 10:01:14 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

It's all coming back to me now...

Bruce_L
Posted : Tuesday, October 25, 2016 10:16:01 AM


Worden Trainer

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

Yes, that is how.

How to add an indicator to a chart template
How to Overlay an Indicator
How to edit an Indicator



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
Posted : Tuesday, October 25, 2016 10:22:42 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Thanks, Bruce. Been a while since I did the "Custom" thing; apparently haven't committed it to memory yet. By default I usually go to the "New" button first.

Tr&eacute;s Cool!! I've seen similar screenshots in the forums before - wondered how they did it. I shuffled the order a bit, but this techinique is awesome.

Thanks again!!

Putt4Dough
Posted : Tuesday, October 25, 2016 10:24:49 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

I'm really beginning to be annoyed by that ampersand. :)

Putt4Dough
Posted : Tuesday, October 25, 2016 10:47:37 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Bruce, another question...

I separated the individual PCFs in the bottom pane for now. Eventually I'll probably pin them off to the side.

What I ultimately care about are the Bullish and Bearish signals provided by the "compound" PCFs. How do I edit the PCFs to get both the red & green dots on the same row? Trying to save screen real estate...

Bruce_L
Posted : Tuesday, October 25, 2016 11:04:12 AM


Worden Trainer

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

Make the number at the front the same....

1 / ABS(AVGC20 > AVGC20.3 AND C < C3 AND C > C23)
1 / ABS(AVGC20 < AVGC20.3 AND C > C3 AND C < C23)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Putt4Dough
Posted : Tuesday, October 25, 2016 11:06:08 AM

Registered User
Joined: 7/30/2007
Posts: 1,072

Nice. Thanks, Bruce!!!

Bruce_L
Posted : Tuesday, October 25, 2016 11:11:22 AM


Worden Trainer

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

You're welcome.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
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.