Coding help - page 244

 

here it is

Files:
 

Hi Mladen i just tried out that EA and it did not work. No sign of working at all. I waited 5 minutes and no take profit/stop loss was set. Message says successful and EA symbol on top most right side on mt4 chart is active. Pls can you kindly use my request above to alter changes to it. Kind regards

 
Dedoctor:
Hi Mladen i just tried out that EA and it did not work. No sign of working at all. I waited 5 minutes and no take profit/stop loss was set. Message says successful and EA symbol on top most right side on mt4 chart is active. Pls can you kindly use my request above to alter changes to it. Kind regards

Dedoctor

This is the result of applying that EA to the chart with an opened order. I simply opened one order and it have set the take profit and stop loss to required values (used all default values) :

PS: use the one attached here. There are 2 changes in the boolean conditions that I had to make in order to make it compile without warnings in the new build of metatrader 4

Files:
 
mladen:
Dedoctor

This is the result of applying that EA to the chart with an opened order. I simply opened one order and it have set the take profit and stop loss to required values (used all default values) :

PS: use the one attached here. There are 2 changes in the boolean conditions that I had to make in order to make it compile without warnings in the new build of metatrader 4

Hahahahahahahaha this is the best trailing EA have seen in recent times, suit me suit me just closed a 4 pip demo scalp just now. Take Mladen from this site and is gone

PS< may be someone should teach me how to upgrade indy on the new build 600 mt4 so I can save someones time here. Although this should be my last request here cos my chart is almost traded clean because I do not rely on most traditional indy for my signals. Will be going live soon after some loss in the past as a result of ignorance. Hard work pays in forex.

MLADEN rocks!.

Great forum!!!!!

 

Hello Mladen Ive tried it on both mt4 build 509 and 610 and it's still not working , except when one of the two is commented.

Dont know what to check for anymore, any ideas?

Files:
564_2.mq4  10 kb
 
sulaimoney:
Hello Mladen Ive tried it on both mt4 build 509 and 610 and it's still not working , except when one of the two is commented. Dont know what to check for anymore, any ideas?

sulaimoney

All is OK with those procedures. Attaching a simple indicator that is showing that all is OK when the calls to those twor procedures is executed one after the other. Check the rest of the code since the error is not in those two procedures

 

Hi Mladen/ Mrtools,

This code is from another charting platform called aspen graphics can it be coded in meta trader and is it possible to explain the logic behind this

CustomCrossover(input, seavg=7, leavg=21, reavg=9, ersi=14)=begin

retval =0

if eavg($1,seavg)>eavg($1,leavg) and eavg($1,seavg)[1]<eavg($1,leavg)[1] then begin

if eavg(rsi($1,ersi),reavg)<rsi($1,ersi) then begin

retval='Buy'|clr_green|fsmall|below|arrow|horizontal

end

end

if eavg(rsi($1,ersi),reavg)rsi($1,ersi)[1] then begin

if eavg($1,seavg)>eavg($1,leavg) then begin

retval='Buy'|clr_green|fsmall|below|arrow|horizontal

end

end

if eavg($1,seavg)eavg($1,leavg)[1] then begin

if eavg(rsi($1,ersi),reavg)>rsi($1,ersi) then begin

retval='Sell'|clr_red|fsmall|above|arrow|horizontal

end

end

if eavg(rsi($1,ersi),reavg)>rsi($1,ersi) and eavg(rsi($1,ersi),reavg)[1]<rsi($1,ersi)[1] then begin

if eavg($1,seavg)<eavg($1,leavg) then begin

retval='Sell'|clr_red|fsmall|above|arrow|horizontal

end

end

retval

end

Thanks in advance

 
macerina:
Hi Mladen/ Mrtools,

This code is from another charting platform called aspen graphics can it be coded in meta trader and is it possible to explain the logic behind this

CustomCrossover(input, seavg=7, leavg=21, reavg=9, ersi=14)=begin

retval =0

if eavg($1,seavg)>eavg($1,leavg) and eavg($1,seavg)[1]<eavg($1,leavg)[1] then begin

if eavg(rsi($1,ersi),reavg)<rsi($1,ersi) then begin

retval='Buy'|clr_green|fsmall|below|arrow|horizontal

end

end

if eavg(rsi($1,ersi),reavg)rsi($1,ersi)[1] then begin

if eavg($1,seavg)>eavg($1,leavg) then begin

retval='Buy'|clr_green|fsmall|below|arrow|horizontal

end

end

if eavg($1,seavg)eavg($1,leavg)[1] then begin

if eavg(rsi($1,ersi),reavg)>rsi($1,ersi) then begin

retval='Sell'|clr_red|fsmall|above|arrow|horizontal

end

end

if eavg(rsi($1,ersi),reavg)>rsi($1,ersi) and eavg(rsi($1,ersi),reavg)[1]<rsi($1,ersi)[1] then begin

if eavg($1,seavg)<eavg($1,leavg) then begin

retval='Sell'|clr_red|fsmall|above|arrow|horizontal

end

end

retval

end

Thanks in advance

macerina

The first part only (the rest is just a variation of that) :

if ema(7) < ema(21) and previous ema(7) < previous ema(21) then if ema(of rsi(14),9) < rsi(14) signal for buy

you can say it this way too :

if macd(7,12) < and previous macd(7,12) < 0 then if ema(of rsi(14),9) < rsi(14) signal for buy

 

osted for Help few post back but while others are getting responses, I haven't even received a couple of words!

 
Oridroo:
osted for Help few post back but while others are getting responses, I haven't even received a couple of words!

Please post the part of the code where you are trying to achieve what you have described here : https://www.mql5.com/en/forum/174385/page162 (not the 3 take profits placing on orders and 3 trailing stops managing, but the part that is trying to do exactly what you have described) and then, maybe someone can help you with your coding.

One problem immediately comes to mind : how do you know that there were 3 orders and then only 1 was left (there is not a single line of code in that EA that is trying to find that out)

Reason: