Ask! - page 160

 
 

Sound File

Hello everybody

I need your help!

I havean indicator(3ZZ Semafor Signal) . It gives an sound alert(ahooga.wav).The problem is I do not have this sound.wav in my Sound. File

What can I do?

Thank you very much for your time

dansmol

P.S. I want to thanks all of you for everything I learned from you all

those years

 

You can take any sound file and rename it to that or you can rename the sound file name in indicator properties.

 

My question has to deal with MTF indicators. The one I have attached to this post I like very much. My issue with it is (like every other mtf indicator) it repaints. Is there not a way that MTF indicators can be coded so as not to repaint? Say I have it running on a 1 minute chart but I have it set to give me signals off a 5 minute chart. Is there no way that it can just get a signal for every minute. I don't care if it is red (or blue) for the first minute of the 5 minute candle it is getting it's signal from. I just don't want after 3 or 4 minutes if the color does change...that the other blocks for that 5 minute candle change as well.

For example. Say it's the 1st block of a new 5 minute candle. The 1st minute ends and the block is blue. Same for the 2nd minute. Then during the 3rd minute the 5 minute candle that it represents goes to a "red block" status. It repaints the 1st and 2nd minute blocks to red to match the current status.

What I would like is for those first two blocks to stay Blue. I would much rather have the minute by minute status of the 5 minute than have it repaint everything.

Is it possible?

Files:
mtf_dmi.ex4  4 kb
 
Supranium:
You can take any sound file and rename it to that or you can rename the sound file name in indicator properties.

Thank you very much for your time,Supranium

I will give it a tray.

I will rename the sound in the indicator inputs,and I will let you know.

All the best

dansmol

 

comparing different MT4 data types

Hi,

I'm trying to see if the tick value is higher than a certain trigger size, but think I have an error trying to compare different data types.

int start()

{

//Make tick size from previous bid value

diff=(Bid-old_value);

//Get Absolute value

diff=MathAbs(diff);

//Make ticksize

tick=diff/Point;

//If tick size is > trigger value...

if(tick > trigger)

{

Do Something

}

//Set current Bid price as "old_value"

old_value = Bid;

return;

}

My variables are currently defined as:

double old_value

double diff

double tick

int trigger

...but sometimes the if(tick > trigger) results as true when the two are the same value. I can print both values to the log and it says tick=1, trigger=1, tick>trigger = TRUE. I don't understand.

If I make the tick variable an integer type rather than a double type, then it SOMETIMES doesn't pick up the right value. ie diff=0.0001, tick=0.

I'm not sure what to do now, so any help would be appreciated.

Thanks

Patrick

 

price X ma

Anyone, I am in need of an indicator or code that will provide a signal or buy/sell when the price breaks (either way) a moving average, one time only, and then resets to close when the price breaks another MA

Example: Signals or sells when price breaks 50 period MA and then closes when price reaches 20 period MA. Or buys when 20 period is breached and closes at 50 period.

If there is anything that fulfills any part or all of these conditions would be much appreciated.

 

Price box for price channel stop

codersguru:
Hi folks,

I've got a lot of private messages asking me for helping with some pieces of code.

Here you can post your questions related to MQL4, and I'll do my best to answer them.

HI Coders' Guru,

Please help me to add Price box for PRICE CHANNEL STOP like as VoltyChannel_Stop.

I attached indicators and chart.

 

MA touch and bounce trades

Hi,

Happy New Year to everybody.

This is another approach for MA trading.

Price approaches a MA (purple line) and bounces after touching or almost touching it.

Price has to be clear of the MA for a certain number of bars - in this case two. Green circles show valid trades - red is not valid.

Trading is AWAY from the MA.

This system needs some session restrictions and trade man. as well - like trading hours, partial take profit and trailing stops.

Anybody able to code this as I'm no programmer?

Cheers

Thomas

Files:
 

LSMA Question

Trying to pin point when one color stops and another begins.

.

Here's the LSMA code:

.

//---- indicator settings

#property indicator_chart_window

#property indicator_buffers 3

#property indicator_color1 Red

#property indicator_color2 Lime

#property indicator_color3 White

//---- buffers

double ExtMapBuffer1[];

double ExtMapBuffer2[];

double ExtMapBuffer3[];

extern int Rperiod = 25;

int Draw4HowLong, shift, i, loopbegin, length, c, width;

double sum[], lengthvar, tmp, wt[], CNT[];

string FoundColor, ArrowUpA;

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

//| Custom indicator initialization function |

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

int init()

{

//---- 3 additional buffers are used for counting.

IndicatorBuffers(6);

//---- drawing settings

SetIndexBuffer(2,ExtMapBuffer1);

SetIndexBuffer(1,ExtMapBuffer2);

SetIndexBuffer(0,ExtMapBuffer3);

SetIndexBuffer(3,sum);

SetIndexBuffer(4,wt);

SetIndexBuffer(5,CNT);

SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,3);

SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,3);

SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,3);

//---- initialization done

return(0);

}

int start()

{ Draw4HowLong = Bars-Rperiod - 5;

length = Rperiod;

loopbegin = Draw4HowLong - length - 1;

for(shift = loopbegin; shift >= 0; shift--)

{

sum[1] = 0;

for(i = length; i >= 1 ; i--)

{

lengthvar = length + 1;

lengthvar /= 3; //Dividing the y variable(lengthvar) by x(3) y /= x;

tmp = 0;

tmp = ( i - lengthvar)*Close[length-i+shift];

sum[1]+=tmp; //Adding x(0) to the y variable(tmp) y += x;

}

wt[shift] = sum[1]*6/(length*(length+1));

//========== COLOR CODING ===========================================

ExtMapBuffer3[shift] = wt[shift]; //White

ExtMapBuffer2[shift] = wt[shift]; //Lime

ExtMapBuffer1[shift] = wt[shift]; //Red

if (wt[shift+1] > wt[shift])

{

CNT[1] = 2;

ExtMapBuffer2[shift+1] = EMPTY_VALUE;

}

if (wt[shift+1] < wt[shift])

{

CNT[1] = 1;

ExtMapBuffer1[shift+1] = EMPTY_VALUE;

}

else

{

CNT[1] = 3;

ExtMapBuffer1[shift+1]=CLR_NONE; //EMPTY_VALUE;

ExtMapBuffer2[shift+1]=CLR_NONE; //EMPTY_VALUE;

}

}

return(0);

}

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

.

.

.

I created another buffer (#5) as a way to capture a value at the time of each "if statement" which should be each of the colors of the LSMA. I set CNT[1] to 1 for RED, 2 for LIME and 3 for WHITE.

.

But, with all my attempts to bring this value into my EA;

.

.

double LSMA5 = iCustom(NULL,0,"LSMA",5,0); //---- LSMA Buffer 5

Alert("LSMA5 = " + LSMA5);

.

.

All I get is;

.

Alert: LSMA5 = 2147483647.00000000

.

.

Can someone tell me what I'm doing wrong? Can someone show me how to capture the point when one color changes to another?

.

.

.

Thanks!

Reason: