Coding help - page 70

 

Distance from MA Alert

Hi Guys,

I had the attached indicator made - it alerts with a vertical line, pop-up and sound when the price reaches a chosen distance from your chosen MA (type & period).

I did request it be coded to alert as soon as the distance target was met, but occasionally I would like it to alert only upon a close at or beyond the distance target. I was wondering if anyone would be kind enough to code a version that signals only upon the bar close, or a version with the two options of either Open or Close.

Thanks in advance.

Files:
 

Hi,

i want know if i start an ea in the strategy tester 1minuti TF and in the code there a string that check m15 TF what is the result of that formula?.

Thank you

 

dasio

If I understand correctly your question, it will get the result from a 15 minute time frame, but since it will read the real data for that 15 minute time frame (with future data already written there and it will not use the "simulated" current data in back-test), it will "know the future" for a current bar.

If you are using multi time frame in EAs always back-test the "other time frame" on a closed bar never on an opened bar (but than that is a good advice for any signals testing : not to test the current bar)

dasio:
Hi,

i want know if i start an ea in the strategy tester 1minuti TF and in the code there a string that check m15 TF what is the result of that formula?.

Thank you
 

can someone help me:

want to make the script one indicator

The indicator marked the outbreak of a price channel (by a point or star). Base is a channel from the highest high and lowest low during the calculation period. The length of the time period is variable.

"Turtle Donuts"

Meta:

Synopsis ("The Turtle Donuts indicator highlights common turtle trading points using a donut.")

Short Code ("TDN")

Subchart (False)

inputs:

Period_Long (20, 1),

Period_Short (10, 1);

If High> HighestFC (High, Period_Long) [1] Then

DrawSymbol (High, "Long", Symbol Donut, 12);

If Low <LowestFC (Low, Period_Short) [1] Then

DrawSymbol (Low, "Short", Symbol Donut, 12);

greeting mahatma

 

Hello

i hope someone can help me.

Im new to coding in mql4 and im trying to find a way to create an aleert if an iCustom indicator crosses a moving average.

To be specific:

if the Linear Regression crosses the EMA.

I had learned that i need to use an Array for this.

But i can not create an iCustom Array....

How would one go about coding the alert ???

Thank yu in advance, this is driving me crazy ! lol

 

Why don't you simply save the value of the iCustom() into a working buffer?

A lot of coding explanations (and examples) you can find at this section : https://www.mql5.com/en/forum

knkie:
Hello

i hope someone can help me.

Im new to coding in mql4 and im trying to find a way to create an aleert if an iCustom indicator crosses a moving average.

To be specific:

if the Linear Regression crosses the EMA.

I had learned that i need to use an Array for this.

But i can not create an iCustom Array....

How would one go about coding the alert ???

Thank yu in advance, this is driving me crazy ! lol
 
prototype01:
Hi Guys,

I had the attached indicator made - it alerts with a vertical line, pop-up and sound when the price reaches a chosen distance from your chosen MA (type & period).

I did request it be coded to alert as soon as the distance target was met, but occasionally I would like it to alert only upon a close at or beyond the distance target. I was wondering if anyone would be kind enough to code a version that signals only upon the bar close, or a version with the two options of either Open or Close.

Thanks in advance.

Hello Prototype,

I use distance from a SMA too....one of my tool is the distance of low-high from this SMA and I need help to code from metastock to mt4...

This ie my formula:

DISTANCEHL15:=If(Mov(C,15,S)>H,-1*((Mov(C,15,S)-L)*100)/L,If(Mov(C,15,S)<L,((H-Mov(C,15,S))*100)/Mov(C,15,S),0));

TRENDLINE:=0;

DISTANCEHL15;

TRENDLINE;

explanation:if sma is above H,plot the distance from SMA and low

if sma is below L,plot the distance from H and SMA.

when the rubber band is too pulled....price comes back to the SMA...

thank's in advance for coding it into mt4! ....or can you adapt your MA_move_v1.9 with my request?

 

To mladen,

if the trend line is a object.

How to read the trend line value at current bar or shift bar?

I want to use value from trend line to confirm signal to buy or sell or close order.

Thank you in advance.

 

Like this :

ObjectGetValueByShift("YourTrendLineName",BarNumber);

Premeus:
To mladen,

if the trend line is a object.

How to read the trend line value at current bar or shift bar?

I want to use value from trend line to confirm signal to buy or sell or close order.

Thank you in advance.
 

To mladen,

How to code to get value from indicator that attach to chart instead of using icustom in EA?

Reason: