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 |

10 days EMa crossover Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
limitlessluca
Posted : Friday, July 1, 2016 12:38:09 PM
Registered User
Joined: 6/13/2015
Posts: 9

Hi, I m trying to find the formula for a symple startegy: Long when 10days EMA cross above 20 days EMA and sell when 10ema cross below 20ema.

It is for the custom PCF % true indicator since i m trying to baktest it.

Any idea

Thanks everybody

limitlessluca
Posted : Friday, July 1, 2016 12:47:38 PM
Registered User
Joined: 6/13/2015
Posts: 9

sorry also a variation of the formula that I would like to backtest is:long on the first candle to open above 10EMA after the 10ema cross above 20 Ema, and close position on the first candle to open below 10 EMa after 10 EMA crossed below 20 EMA.

thanks

Bruce_L
Posted : Friday, July 1, 2016 12:47:42 PM


Worden Trainer

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

A Condition Formula for the EMA10 crossing up through EMA20 can be written as follows.

XAVGC10 > XAVGC20 AND XAVGC10.1 <= XAVGC20.1

A Condition Formula for the EMA10 crossing down through EMA20 can be written as follows.

XAVGC10 < XAVGC20 AND XAVGC20.1 >= XAVGC20.1

A Condition Fomula for the EMA10 crossing through EMA10 in either direction can be written as follows.

SGN(XAVGC10 - XAVGC20) <> SGN(XAVGC10.1 - XAVGC20.1)



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
Bruce_L
Posted : Friday, July 1, 2016 1:24:35 PM


Worden Trainer

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

You could plot the following Custom PCF Indicator using the Dot Plot Style in the same pane and scale as price to see the price which would have caused the 10 and 20 period EMAs to cross.

(209 * XAVGC20.1 - 189 * XAVGC10.1) / 20 / ABS(SGN(XAVGC10 - XAVGC20) <> SGN(XAVGC10.1 - XAVGC20.1))



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
limitlessluca
Posted : Friday, July 1, 2016 1:31:47 PM
Registered User
Joined: 6/13/2015
Posts: 9

Thanks I m getting an error when plotted in ( ERROR: must be a boolean formula

 

Bruce_L
Posted : Friday, July 1, 2016 1:42:03 PM


Worden Trainer

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

It reads like you are trying to use my Friday, July 01, 2016 1:24:35 PM ET post in a Custom PCF % True Indicator instead of using it in a Custom PCF Indicator using the Dot Plot Style in the same pane and scale as price as instructed.



-Bruce
Personal Criteria Formulas
TC2000 Support Articles
limitlessluca
Posted : Friday, July 1, 2016 3:34:35 PM
Registered User
Joined: 6/13/2015
Posts: 9

got it thanks

Bruce_L
Posted : Friday, July 1, 2016 3:39:54 PM


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.