Movers and Shakers (Price)

Here you can post and download custom indicators. PLEASE: Do not start topics unless you are posting your own indicator, they will be moved to appropriate section even if you do.

Moderator: admin

Movers and Shakers (Price)

Postby Apprentice » Mon Jan 24, 2011 4:17 am

X.png

This indicator creates a list of available currency pairs,
Displays Pip or the percentage change for the defined time frames.

Allows sorting by time frame.

By defult period is set to 0
In this case, the indicator shows a change from the beginning of the current period.
If you use a different value.
Change is calculated in relation to the open value n periods ago.

This is a prototype for such indicators.
Improvements in performance, functionality, are likely.

This type of indicators can be written for individual indicator or strategy.

I hope that in future we will have a separate module with a lot more options.

Movers and Shakers.lua
(13.25 KiB) Downloaded 3177 times

Movers and Shakers with ATR.lua
(14.63 KiB) Downloaded 967 times


A similar list, which allows you to add up to four filters can be found here.
viewtopic.php?f=17&t=3262&p=7733&hilit=list#p7733

A similar list,which allows you to monitor all the currency pairs that contain a defined currency.
viewtopic.php?f=17&t=8257&p=18259#p18259
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Movers and Shakers (Price)

Postby Ichi4me » Tue Feb 07, 2012 8:31 am

Hi Apprentice -

I've tried to add Average True Range to this indicator, but the values I am getting don't match the values from the ATR indicator. Any thoughts on how to fix this?

ATR.png
User avatar
Ichi4me
 
Posts: 5
Joined: Tue Feb 07, 2012 7:57 am

Re: Movers and Shakers (Price)

Postby Apprentice » Wed Feb 08, 2012 6:54 am

Try My Version.



You have get almost everything right.
But not this line.
Code: Select all
Total = mathex.avg (temp, period - n + 1, period);


You are using a "period" as referance.
Your implementation is accurate only for chart time frame.
Something like this would have been better.

Code: Select all
Total = mathex.avg (temperature, stream [i * 20 + j]. High [stream [i * 20 + j]: size () - 1] - n + 1, stream [i * 20 + j]. High [stream [i * 20 + j]: size () - 1]);


But you hava some other problems if you use this line.
My version circumventing them.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Movers and Shakers (Price)

Postby Ichi4me » Wed Feb 08, 2012 7:30 am

Dude, you rock!

If you ever come to Australia, I will buy you a very big beer.

Thank you!
User avatar
Ichi4me
 
Posts: 5
Joined: Tue Feb 07, 2012 7:57 am

Re: Movers and Shakers (Price)

Postby Apprentice » Wed Feb 08, 2012 8:23 am

I have a better idea.
Buy me a cocktail, here in Croatia.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Movers and Shakers (Price)

Postby Pipfind » Wed Feb 08, 2012 12:38 pm

I really like this movers and shakers.lua.

One challenge I find with this indicator is that once a new candle starts, I don't have much of a gauge for relative strength/weakness.

How about an enhancement that is based on the number of candles for a given time frame? So rather than looking at the current price versus the close of the previous 4hr candle (or daily, etc), how about if it looks at the current price relative to the closing price of 'X' candles ago? That way, If I wanted to keep a consistent look of the past 80 days or eighty 1 hr candles, I can gain a sense of relative strength over a consistent time period.

It seems like this type of modification would be fairly easy. Is it possible?

Thank you!
Pipfind
 
Posts: 2
Joined: Wed Feb 08, 2012 12:23 pm

Re: Movers and Shakers (Price)

Postby Apprentice » Wed Feb 08, 2012 5:13 pm

To be honest I have not thought about it.
I have just recreated a tool that I use in my trading.
Someone would say, that for this purpose you have Higer time frame.
But I see your point.
I will try to fix something soon.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Movers and Shakers (Price)

Postby Apprentice » Thu Feb 09, 2012 11:22 am

I made small Face lift of top most version,
added some new functionalities.
User avatar
Apprentice
FXCodeBase: Confirmed User
 
Posts: 36341
Joined: Thu Dec 31, 2009 11:59 am
Location: Zagreb, Croatia

Re: Movers and Shakers (Price)

Postby Ichi4me » Wed Feb 22, 2012 8:49 am

I have modified this by adding Position Sizing based on Daily ATR.

ATR Dollar Value represents the amount you wish to risk (or gain) if the price moves by the current ATR for the given period. You can use this to ensure that your risk or reward is the same for one ATR of movement across different instruments.

I have calculate Position size as ATR Dollar Value / (ATR x PipCost).

Here's an example:
ATR Dollar Value = $1000
EUR/USD 14 Day ATR = 0.0121
EUR/USD PipCost = 0.94
ATR x PipCost = 11 (rounded to the nearest integer)
Position Size = $1000 / 11 = 88

Since contract sizes are multiples of 10, you would us a postion size of 80 (rounding down) or 90 (rounding up).

The other way I use this information is to identify which pairs to trade. I have colored a pair's values green if the Position Size is less than ATR Dollar Value/10, and red if the Position Size is greater than ATR Dollar Value/10. This could be improved by sorting on Position Size.

In general, it does what I need it to. However, my programming abilities are not all that great, and I don't have much time to dedicate to fixing it up. If a high-powered programmer like you, Mr. Apprentice wants to look this over, I'm sure you can make it much more elegant than my hackwork.

I've also used this with my live account, which has access to all pairs, so I have set the limit of the arrays higher than the standard 20 symbols allowed in a demo version. I haven't actually used this on a demo version, so not sure what will happen. Again, if someone wants to do a bit of fixing so that it only allows 20 symbols, go right ahead.

The other obvious issue is that it does not display any text at the top of the columns or the last two values for the first two or three rows. I don't trade any of these symbols, so am not too bothered by it. But if someone wants to fix this, be my guest. I'm thinking that this whole concept is getting a bit far from the original purpose of this thread, so if anyone wants to simply rename this indicator to "Position Sizing" and start a new thread, go for it!

PositionSize.png
Attachments
Movers and Shakers with Position Size based on Daily ATR.lua
(16.65 KiB) Downloaded 1602 times
User avatar
Ichi4me
 
Posts: 5
Joined: Tue Feb 07, 2012 7:57 am

Re: Movers and Shakers (Price)

Postby Pipfind » Mon Nov 26, 2012 12:38 pm

Apprentice wrote:
M&S.PNG


This indicator creates a list of available currency pairs,
Displays Pip or the percentage change for the defined time frames.

Allows sorting by time frame.

By defult period is set to 0
In this case, the indicator shows a change from the beginning of the current period.
If you use a different value.
Change is calculated in relation to the open value n periods ago.

This is a prototype for such indicators.
Improvements in performance, functionality, are likely.

This type of indicators can be written for individual indicator or strategy.

I hope that in future we will have a separate module with a lot more options.

Movers and Shakers.lua


This is great Apprentice.

As I used this, I noticed some of the cross pairs were not included. My TSII allows for more than 20 pairs. Would it be possible to calculate for the already mentioned 20 pairs + 8 other cross pairs?

Namely, include the following:
EURNZD
GBPNZD
GBPAUD
AUDCHF
CADCHF
NZDCHF
CADCHF
AUDNZD

I like the visual output and would simply like to see the above 8 pairs added to the calculation.

Thank you very much!
Pipfind
 
Posts: 2
Joined: Wed Feb 08, 2012 12:23 pm

Next

Return to Custom Indicators

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 48 guests