How to code? - page 104

 

Line colour

Hi again

I am creating an indicator which draws a line across the chart (in a similar way to a moving average does).

The line is plotted with values taken from a buffer.

I'd like the line to be drawn green if the value on the current bar is higher than the value on the previous bar, and red if it is lower.

How can I do this?

Thanks in advance for any help.

 

Basically I'd like it to look like this:

Files:
line.gif  7 kb
 

Why did my last post get moved from the main programming forum to the end of this thread?

(Thanks for the MathCos help too guys!)

 

Above problem has been solved

 

Modification of EA

Hi,

At the moment ea : boincinPipEA_BigBear_nonlagdot uses as a main indicator : NonLagZigZag_v2 and ZigZag Pointer , and as a filter nonlagdot.

Is it posible to delate NonLagZigZag_v2 and ZigZag Pointer from source code and make nonlagdot main indicator?

Im not good in programming, any idea what to change?

Thank you for your help.

 
mladen:
every coding language has its problems, and maybe we should simply find solutions in our environment (solutions are there, all we have to do is to find them out)

Nice comment! Totally agree.

Lux

 

close all after certain % profit

hi,

I want to close all trades if % gain is achieved on a weekly base.

So I need to know the accountbalance sundayevening 24.00 - no problem.

I need to know equity on sundayevening 24.00 - no problem.

But how do I store these? And how to let the ea read these values, for if there is a powerbreakdown the ea will have to start again and have to read the values from the stored place.

I know how to do this in VB, but how do I do this in mql?

I would be gratefull if someone can point that out.

 

Write them to a file. Take a look in the help files and you'll figure it out.

Good luck.

LUx

 

Price label and text

Hi

can somebody guide/teach me how to put Price label and Text properly.I already search and found this

https://www.mql5.com/en/forum/175530

if(ObjectFind("P label") != 0)

{

ObjectCreate("P label", OBJ_TEXT, 0, Time[0], Close[0]);

ObjectSetText("P label", "Price", 10, "Arial", Red);

}

else

{

ObjectMove("P label", 0, Time[0], Close[0]);

}

[/CODE]

[CODE]ObjectCreate("Trade", OBJ_LABEL, 0, 0, 0);

ObjectSetText("Trade", "n", 40, "Wingdings", Red);

ObjectSet("Trade", OBJPROP_CORNER, 1);

ObjectSet("Trade", OBJPROP_XDISTANCE, 30);

ObjectSet("Trade", OBJPROP_YDISTANCE, 30);

But still do not know how to apply.I attach together this indicator for my study in coding

Example like picture below,this is what i want,thanks!!

Files:
teach.gif  12 kb
 

ops,i already found the source code.Got it from here

Waddah Attar Dayly CAMERILLA - MQL4 Code Base