Jump to content

Need help for indicator


jjames

Recommended Posts

Hi i wanna ask if soemeone can help me with making this indactor for me.

 

I want a indicator who can plce 2 horizontal lines of the price (area where the ma's are on the dailly to shorter timeframes.

 

The ma's are 3simple high the other 1 is simple ma 3 low.

 

Here 2 screenshots to see it better what i mean i want it like that the guy who has this indie doesnt wanna share it.

 

Oke this 1 shows the 3bar ma hi/lo http://img252.imageshack.us/img252/1657/201007271025.png

 

This is the chart with the horizontal lines plotted on the smaller timeframes.

 

http://img814.imageshack.us/img814/7440/201007271027.png

 

I hope someone can help me with this if so i will help him to learn a strategy what makes money.

 

Thanks

 

JJ

Link to comment
Share on other sites

Here you go.......cut and paste into metaeditor and save in your indicators folder.

 

//+------------------------------------------------------------------+

//| Daily_Hi_Lo.mq4 |

//| Copyright © 2010, Kenny Hubbard |

//| http://www.compu-forex.com |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2010, Kenny Hubbard"

#property link "http://www.compu-forex.com"

 

#property indicator_chart_window

 

extern int MA_Period = 3;

 

string

Hi_Line = "Hi_Line",

Lo_Line = "Lo_Line";

color

Hi_Col = Red,

Lo_Col = Blue;

double

Day_Hi,

Day_Lo;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

Day_Hi = iMA(Symbol(),PERIOD_D1,MA_Period,0,MODE_SMA,PRICE_HIGH,0);

Day_Lo= iMA(Symbol(),PERIOD_D1,MA_Period,0,MODE_SMA,PRICE_LOW,0);

ObjectCreate(Hi_Line,OBJ_HLINE,0,0,Day_Hi);

ObjectSet(Hi_Line,OBJPROP_COLOR,Hi_Col);

ObjectCreate(Lo_Line,OBJ_HLINE,0,0,Day_Lo);

ObjectSet(Lo_Line,OBJPROP_COLOR,Lo_Col);

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

ObjectDelete(Hi_Line);

ObjectDelete(Lo_Line);

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

if(New_Bar()){

Day_Hi = iMA(Symbol(),PERIOD_D1,MA_Period,0,MODE_SMA,PRICE_HIGH,0);

Day_Lo= iMA(Symbol(),PERIOD_D1,MA_Period,0,MODE_SMA,PRICE_LOW,0);

if (ObjectFind(Hi_Line)>-1)ObjectDelete(Hi_Line);

if(ObjectFind(Lo_Line)>-1)ObjectDelete(Lo_Line);

ObjectCreate(Hi_Line,OBJ_HLINE,0,0,Day_Hi);

ObjectSet(Hi_Line,OBJPROP_COLOR,Hi_Col);

ObjectCreate(Lo_Line,OBJ_HLINE,0,0,Day_Lo);

ObjectSet(Lo_Line,OBJPROP_COLOR,Lo_Col);

}

return(0);

}

//+------------------------------------------------------------------+

bool New_Bar()

{

static datetime

New_Time=0;

//----

if(New_Time!=Time[0]){

New_Time=Time[0];

return(true);

}

//----

return(false);

}

//+------------------------------------------------------------------+

Link to comment
Share on other sites

yep, i get the following error messages when trying to complie the indicator:

 

'PRICE_' - variable not defined C:\uwc\experts\indicators\test2.mq4 (27, 54)

'HIGH' - variable not defined C:\uwc\experts\indicators\test2.mq4 (27, 61)

'PRICE_' - variable not defined C:\uwc\experts\indicators\test2.mq4 (28, 53)

'LOW' - variable not defined C:\uwc\experts\indicators\test2.mq4 (28, 60)

'PRICE_' - variable not defined C:\uwc\experts\indicators\test2.mq4 (52, 54)

'HIGH' - variable not defined C:\uwc\experts\indicators\test2.mq4 (52, 61)

'PRICE_' - variable not defined C:\uwc\experts\indicators\test2.mq4 (53, 53)

'LOW' - variable not defined C:\uwc\experts\indicators\test2.mq4 (53, 60)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...