MQL4 Learning - page 9

 

is this misleading common?

MetaTrader 4.00 build 202

when pointing on bar with mouse - cant be sure about the data.

Files:
same_bar.jpg  144 kb
 

VC6 C++, DLL, Metatraderand Debugging

Hello Everyone,

Does anyone know how to setup MT4 and/or VC6 so that I can use the VC debugger as my DLL is being called?

It seems that MT4 only sees my DLL if it is in the root of the MT4 Directory.

Thank you for your Time and Effort.

EK

 

% from open indicator

I am looking for an indicator that will draw a line _ % from the open 00:00

like 2% of the open price draw line

 

Great site

 

How to add pipstep in EA..

HI Guys ,

can someone please tell me how can i add the pipstep function so that if the price moves say 20 pips in opposite direction the it opens another order...

Thanks

 

How can I make the deal ticket/order smaller

The deal ticket/order is covering almost the whole screen. Is there any script etc that can simplify ( reduce the size ) with only a buy/sell * the price * amount-lots on it?

Thanks in advance

 

Shift in Indicator

Why does the following INDICATOR CODE draw only a horizontal line on the main CHART window.

If I change the price registers CODE (O,H,L,C)for example e.g.

From Low[7] to Low[pos+7] it draws a graph, However it shifts the indicator forward approx 16 bars

int start()

{

int counted_bars=IndicatorCounted();

//----

//---- check for possible errors

if (counted_bars<0) return(-1);

//---- last counted bar will be recounted

if (counted_bars>0) counted_bars--;

int pos=Bars-counted_bars;

//---- main calculation loop

//pos = 200;

while(pos>=0)

{

double dHigh;

double dLow7, dLow9, dLow13, dLow25 ,dClose16 ;

double dResult, dClose20, dCalc, dFallBack ;

//dWhatEver = 1;

dFallBack = 4.00003 + ((Close[16] * 10000) - 13000) ;

dLow7 = ((Low[7]*10000)-13000);

dLow9 = ((Low[9] * 10000) - 13000);

dLow13 = ((Low[13] * 10000) - 13000);

dLow25 = ((Low[25] *10000) - 13000);

dClose20 = ((Close[20] * 10000) - 13000);

dCalc = dFallBack;

if(dLow7 > dCalc)

{if(dLow25 > dCalc)

{if(dLow9 > dCalc)

{if(dLow13 > dCalc)

{if(dClose20 > dCalc)

{ dCalc = dCalc + 5.00022;

}else {}

}else {}

}else {}

}else {}

}else {}

dResult = ((dCalc + 13000) / 10000);

//dResult = dResult + 1.310;

//Comment("Number1 = ", DoubleToStr(dClose,4));

//Comment("Number2 = ", DoubleToStr(dLow,4));

Comment("Number3 = ", DoubleToStr(dResult,4));

ExtMapBuffer1[pos]= dResult ;

pos--;

}

//----

return(0);

}

 

adding "trade from" feature to an Expert?

Hi all, i am experimenting with the FXiGOR Dynamic Breakout Expert. It already has a close feature, what i wish to do is add a "open" or "Start" feature. I know experts such as Firebird and others have this, and i've tried to tweak it but to no success. It should be fairly simple fix though at this time it's beyond me.

Here is the indicator:

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

Cheers,

Thom

 

Unknown ticket for OrderModify

I've spent the last couple of days trying to learn MQL4 and programming a simple system, but have run into a problem I am unable to figure out.

I get 'Unknown ticket for OrderModify' when trying to modify an order with the following code:

"

if (reversal_long(valid_bars_limit)>reversal_point_long)

{

reversal_point_long=reversal_long(valid_bars_limit);

Comment(reversal_point_long);

OrderModify(OrderTicket(),OrderOpenPrice(),reversal_point_long,OrderTakeProfit(),0,Green);

}

"

I've used the Comment to check if the calculations are correct and it changes according my calculations.

Still the open order does not change the stoploss and only generates the error.

Any clues as to ehat I'm doing wrong?

Thanks,

Rayner

 

Looking for an example of code

Is anyone aware of any example of code or an EA which permits you to define (in the user interface) the number of trades you will take during any given move or time period. For example after a new trend is established I may wish to take one (lets say 10 pip) trade in a ranging pair and X number of trades in a trending pair. Any help, ideas or suggestions along this line would be appreciated.

Greg