Sharesmagazine
 Home   Log In   Register   Our Services   My Account   Contact   Help 
 Stockwatch   Level 2   Portfolio   Charts   Share Price   Awards   Market Scan   Videos   Broker Notes   Director Deals   Traders' Room 
 Funds   Trades   Terminal   Alerts   Heatmaps   News   Indices   Forward Diary   Forex Prices   Shares Magazine   Investors' Room 
 CFDs   Shares   SIPPs   ISAs   Forex   ETFs   Comparison Tables   Spread Betting 
You are NOT currently logged in
 
Register now or login to post to this thread.

The Forex Thread (FX)     

hilary - 31 Dec 2003 13:00

Your browser does not support JavaScript! Your browser does not support JavaScript!
Your browser does not support inline frames or is currently configured not to display inline frames.
Forex rebates on every trade - win or lose!

MightyMicro - 06 Jun 2008 15:44 - 9852 of 11056

Foxey: Our Hil says that to all the boys. She's such a flirt. But nice legs . . .

FreemanFox - 09 Jun 2008 08:14 - 9853 of 11056

Hils,

Not really had much chance to debug your code over the weekend but the code below now works. Main issue seemed to be, that however you copied it from your original indicator you truncated some key code at the ends of some lines. (I think you need a better cut 'n' paste tool !!).

There's still things that need to be sorted, like the position of where it plots the arrows could be made better and also it plots multiple arrows when you use a higher timeframe.

I'm not going to be able to look at sorting the remaining issues and give it a thorough testing until later in the week at the earliest but you may be able to pick it up and sort it now that the major problems with it are resolved. Let me know how you get on and I'll pick up the posts later in the week.

//+------------------------------------------------------------------+
//| MTF MACD Crossover Arrows & Alert |
//+------------------------------------------------------------------+

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_width1 3
#property indicator_color2 Magenta
#property indicator_width2 3



extern string note1 = "Arrow Type";
extern string note2 = "0=Thick, 1=Thin, 2=Hollow, 3=Round";
extern string note3 = "4=Fractal, 5=Diagonal Thin";
extern string note4 = "6=Diagonal Thick, 7=Diagonal Hollow";
extern string note5 = "8=Thumb, 9=Finger";
extern int ArrowType=2;
extern string note6 = "--------------------------------------------";
extern string note7 = "turn on Alert = true; turn off = false";
extern bool AlertOn = true;
extern string note8 = "--------------------------------------------";
extern string note9 = "send Email Alert = true; turn off = false";
extern bool SendAnEmail=false;


string AlertPrefix;
string GetTimeFrameStr() {

}
//---- input parameters
/*************************************************************************
PERIOD_M1 1
PERIOD_M5 5
PERIOD_M15 15
PERIOD_M30 30
PERIOD_H1 60
PERIOD_H4 240
PERIOD_D1 1440
PERIOD_W1 10080
PERIOD_MN1 43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
---------------------------------------*/

extern int TimeFrame=0;

//---- input parameters
extern int MACD_Fast = 12;
extern int MACD_Slow = 26;
extern int MACD_Slowing = 9;
extern int Bars_Count= 20000;

//---- buffers
double CrossUp[];
double CrossDown[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+

int init()
{
//---- indicators
if (ArrowType == 0) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 233);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 234);
}
else if (ArrowType == 1) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 225);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 226);
}
else if (ArrowType == 2) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 241);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 242);
}
else if (ArrowType == 3) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 221);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 222);
}
else if (ArrowType == 4) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 217);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 218);
}
else if (ArrowType == 5) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 228);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 230);
}
else if (ArrowType == 6) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 236);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 238);
}
else if (ArrowType == 7) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 246);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 248);
}
else if (ArrowType == 8) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 67);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 68);
}
else if (ArrowType == 9) {
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0, 71);
SetIndexStyle(1,DRAW_ARROW);
SetIndexArrow(1, 72);
}

SetIndexBuffer(0, CrossUp);
SetIndexBuffer(1, CrossDown);


AlertPrefix=Symbol()+" ("+GetTimeFrameStr()+"): ";

//---- name for DataWindow and indicator subwindow label

switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period M1"; break;
case 5 : TimeFrameStr="Period M5"; break;
case 15 : TimeFrameStr="Period M15"; break;
case 30 : TimeFrameStr="Period M30"; break;
case 60 : TimeFrameStr="Period H1"; break;
case 240 : TimeFrameStr="Period H4"; break;
case 1440 : TimeFrameStr="Period D1"; break;
case 10080 : TimeFrameStr="Period W1"; break;
case 43200 : TimeFrameStr="Period MN1"; break;
default : TimeFrameStr="Current Timeframe";
}


//----

return(0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}


//+------------------------------------------------------------------+
//| MTF MACD Crossover |
//+------------------------------------------------------------------+

int start()
{

datetime TimeArray[];
int i,limit,y=0,counted_bars=IndicatorCounted();

// Plot defined time frame on to current time frame

ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);

limit= Bars-counted_bars;
for(i=0,y=0;i

hilary - 09 Jun 2008 09:30 - 9854 of 11056

Foxey,

You've been very kind to help out. Thank you.

Unfortunately though, I can't get your version to compile. I'm sure that it does compile, otherwise you wouldn't have bothered to paste it up. I really do think that there must be a problem with our cut and paste tools.

Help???????

FreemanFox - 09 Jun 2008 10:11 - 9855 of 11056

Hils,

That's weird. I can see the bits of code that have not copied across correctly. If I cut 'n' paste it into word or notpad it works fine.

If I do the same into a MoneyAM post it looks correct during the editing but once the message is posted things disappear. There must be something going on strange with the MoneyAM's posting process.

If you want to drop me your email address I'll send it to you when I return later today.

hilary - 09 Jun 2008 10:46 - 9856 of 11056

Thanks Foxey. Message sent.

FreemanFox - 10 Jun 2008 08:10 - 9857 of 11056

Hils, message sent.

hilary - 10 Jun 2008 21:11 - 9858 of 11056

Foxey,

I've noticed something weird concerning the problem that we're already aware of about how the MTF version of the MACD crossover indicator paints its arrows.

Here's a piccie of today's M5 Gold chart.



I've annotated it with my comments. The indicator timeframe is M15, so it paints 3 arrows for historical crossovers which we already know about. When you leave it running for new arrows to paint, I've noticed that it only paints one arrow as it should.

If you switch timeframes and go back to the M5, the single arrow will then repaint with 3 arrows.

Does that make sense? You need to leave it running to see for yourself.

Weird.

FreemanFox - 11 Jun 2008 08:19 - 9859 of 11056

Hi Hils,

Yeah I spotted it myself when I left it running. I know how to sort all the issues with it but just not got time at the moment.

As soon as I can (probably weekend or early next week) I'll fix it. I think it will be pretty useful when complete. Let me know if you spot any other 'features' that need sorting.

Seymour Clearly - 11 Jun 2008 13:52 - 9860 of 11056

Usd/Cad is under severe pressure as a large sell order rumoured to be in the region of 2 yards hits the market and there is talk that only a quarter of it has been filled so far.

What's that mean? Just out of interest - no position.

Spaceman - 11 Jun 2008 14:57 - 9861 of 11056

In Forex trading jargon, a yard means a billion units.

hilary - 11 Jun 2008 15:27 - 9862 of 11056

Foxey,

There's no great rush to sort the multiple paint problem as it does the job and the problem has now become simply cosmetic. It would be good if you are able to resolve it though when you do get some spare time.

I'm already finding the MTF version useful. This was the last piece of the jigsaw that I have been looking for which has now enabled me to trade each cross or pair entirely from one screen without needing to switch screens.

Along the way, I have also acquired the knowledge to be able to code an indicator which will produce Ruthie's Magic ArrersTM. I haven't written it yet, but will do over the next few weeks.

One other thing. Has anybody noticed all of the new instruments available with ODL? They're now covering a couple of soft commodities, the major indicies and all of the FTSE stocks.

Seymour,

I'm pleased to see you're putting that link to good use.

Seymour Clearly - 11 Jun 2008 16:04 - 9863 of 11056

Can't really get my head round 2 billion units! More hilary's sort of volume ;-)

Cheers Spacey.

hilary - 12 Jun 2008 12:29 - 9864 of 11056

June 12, 2008
Irish 'yes' camp confident - if people come out for treaty vote
David Sharrock, Ireland Correspondent


Irish leaders were campaigning up to the last moment yesterday in a desperate effort to persuade waverers, with final polls showing the “yes” and “no” camps in the referendum running neck and neck.

“People realise it’s a big decision,” Brian Cowen, the Taoiseach and Fianna Fl leader, said on the eve of the vote that is seen as pivotal to the EU’s future. “As we come closer to the day, I’ve always held the belief that the common sense of the Irish people will win out in the end.”

Today the Irish Republic will decide the fate of the Lisbon treaty. Every vote cast is absolutely vital to the outcome of a contest in which less than one per cent of the European Union’s population endorse or reject a blueprint salvaged from the wreck of the European Constitution.

Mr Cowen has been striving since the weekend to present a united front, with more than 90 per cent of the country’s elected politicians endorsing a “yes” vote on the ground of the benefits, past and future, that Ireland reaps from EU membership.

The message has been clouded by the confusion over what is in the treaty and what it will mean for Irish people. The “no” camp insists that it will sound the death knell for the Republic’s low-tax regime that has made it so attractive to US multinational companies.

“Europe has been good for Ireland, Ireland has been good for Europe, and . . . I can confirm without any equivocation there is nothing for us to fear in this treaty,” Mr Cowen said in Longford, in the Irish midlands.

Senior Fianna Fl strategists are predicting a “yes” victory by a slim margin, but they admit that the turnout will be crucial. In 2001 the Nice treaty referendum was lost, an outcome attributed to a poor 34 per cent turnout, which was deemed to favour the “no” camp. The referendum was rerun a year later and the “yes” camp won in a 49 per cent turnout.

That means that the formidable Fianna Fl electoral machine will be working flat out today, with party workers ferrying and chivvying voters to the polling stations.

A senior party figure said: “We are predicting a 52-48 per cent share of the votes in favour of a ‘yes’. An Irish Times poll of last week which put the ‘no’ camp five points ahead actually did us a favour. It galvanised our party machine and we detect that since the weekend the ‘no’ vote has peaked and we are resurgent.”

This would follow a pattern set in last year’s general election when Fianna Fl started badly but gathered momentum to win its third consecutive victory under Bertie Ahern. Mr Ahern was forced to resign last month over lingering questions about his personal finances.

Ireland is the only EU state constitutionally obliged to hold a referendum. Finland, Estonia and Greece became the latest EU countries yesterday to approve the Lisbon treaty by parliamentary vote.

Mr Cowen has cleared his official diary tomorrow to deal with any potential fallout from the result. He was to have attended a peace conference in Donegal.

hilary - 12 Jun 2008 18:04 - 9865 of 11056

Foxey,

I've noticed something about the alert box in the MTF version of the MACD crossovers.

Because it links using iCustom, changing the alert settings does nothing whatsoever. The only way of adjusting the alert at the moment is by changing the coding of the main indicator.

hilary - 13 Jun 2008 08:20 - 9866 of 11056

If anyone is unsure about the significance of the Irish referendum on the Lisbon Treaty, may I suggest they revisit some Euro charts from the spring of 2005 when the French and the Dutch held their own referendums about an earlier treaty and said an emphatic "No".

As I recall, the selling was relentless. The Irish vote should come in around tea time and it is expected to be very close because of the turnout.

Kayak - 13 Jun 2008 10:50 - 9867 of 11056

No

hilary - 13 Jun 2008 12:53 - 9868 of 11056

The Irish Justice Minister Dermot Ahern conceded that the Irish voters have rejected the EU's Lisbon treaty.

jeffmack - 13 Jun 2008 13:55 - 9869 of 11056

So where should we put our money Hils

hilary - 13 Jun 2008 14:06 - 9870 of 11056

Under the mattress for the moment, Jeffie.

Cable - Weak sell
Fiber - Flat. Stops from earlier short triggered with US CPI. Might be trying to rally
EUR/JPY - Strong sell from early this morning so potential for further gains may be limited
USD/JPY - Weak sell. May gain momentum this afternoon
Gold - Weak buy. May gain momentum this afternoon

jeffmack - 13 Jun 2008 14:09 - 9871 of 11056

Thanks princess, tell me where to put my money, Banks not paying enough interest
Register now or login to post to this thread.