MQL4 Learning - page 2

 

MA Simple variable?

What is a code for the next variable:

MA simple; period 1; median price (HL/2)

 

need help with bar analysis

Can anyone recommend a method or indicator for determining the type of move in a short term trend. For example, I would like to be able to determine the differece between a gradually stepping bar pattern on lower tf charts vs a volitilty move. Has anyone experimented with this approach or have any ideas, info, etc.?

 

MT4 Bugs?

Could someone advice me on why this order open?

I had test an EA which create a pending order

2006.07.28 12:25:03 '1136246': pending order buy stop 0.10 NZDUSD at 0.6165 sl: 0.6155 tp: 0.6185

Order confirmation:

2006.07.28 12:25:04 '1136246': order is open : #8521433 buy stop 0.10 NZDUSD at 0.6165 sl: 0.6155 tp: 0.6185

This order (#8521433) open without hitting the buy price at 0.6165 and at the same time it also close the order which is my stop loss 0.6155. at 2006.07.28 12:28

Order No: 8521433 (Highlighted)

MT4 open and close at the same time, when it had hit stop loss?

But it is a pending order if it not hit the buy price it wont open right?

Could anyone of you tell me why? Or mybe it is my mistake?

THANKS

Files:
forex.jpg  177 kb
 

Other Order entry system available for MT4?

Hi all,

I am new to MT4.

Currently I use Ninjatrader order system trading thru Interactive Brokers.

Thinking about trading the Forex Eur/USD and want to use MT because a few people created a Murrey Math indicator for this platform.

However I don't like the order entry system at all

(compare it @ www.ninjatrader.com)

Is it possible to create your own order entry system in MT4? Or, did somebody do this before? I'm willing to pay for it if it meets my needs.

Many thanks in advance for your replies

Regards,

 

On Screen Movable Limit Orders

Back when I was trading with CMS-forex, the thing I loved most about the platform was the ability to change a limit order by clicking and dragging the line on the screen to any price level. After moving the line a pop up box would appear asking to confirm the change. Any chance MetaTrader could implament something similar?

 

Most Recent Occurrence Function

Hi, is there any MT search function returns like the MRO (Most Recent Occurrence) function in the EasyLanguage TradeStation?

I want the function to return when i search, for example the indicator RSI is > 70. And it is the most recent result within the number of trailing bars to serach.

If there isn't any MRO MT function, could anyone help to convert the function in the EasyLanguage TradeStation to MT4?

// Description: Most Recent Occurrence

Inputs: Expression(TrueFalseSeries), Length(NumericSimple), Occur(NumericSimple);

Variables: TrueCount(0), Counter(0);

Counter = 0;

TrueCount = 0;

While Counter < Length AND TrueCount < Occur Begin

If Expression[Counter] Then

TrueCount = TrueCount + 1;

Counter = Counter + 1;

End;

If TrueCount >= Occur AND TrueCount > 0 Then

MRO = Counter - 1 + CurrentBar - BarNumber

Else

MRO = -1;

// End

Appreciate anyone can help me..thanks.

Fonz

 

How to Detect Order was Close by stop loss????

Dear All,

does anyone here know mt4 code that detect order was closed by stoploss??

thank's for any help.....

 

Display arrows in ordersend()

Hi,

I'm using the ordersend() function in MT4 but am unable to get the arrows displayed. Is there something else I have to do other than this:

ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,0,"MyEA",12345,0,DodgerBlue);

My code works and the orders are placed, but the arrows don't show in the chart window.

Thanks,

Bryon

 

default settings for orders

I wish to have orders with default number of pips away from current price for limit/stop price, take profit, stop loss so i dont need to input every time.

Is there anyway to do this? thanks much.

 

how do i word this expression?

i'm (still ) working on programming good friday's occurence. i've got the sequence of the full moon set, and i also have my variable, full moon, to be an integer, from a double, and i've encountered yet another dam in my river of thought. (man i hate it when i run into thoose !)

this last expression i've been working on in my good friday testing funciton involves using some c++ terms i've never seen in any refrence or other code, as i'm not a professional programmer, i'm groping in the dark really.

here's what i want the string to say. this is the wednessday before the sunday after the first full moon after march 21'st.

here's what i was thinking of when i started this expression step by step.

// if the month = march, the day is greater than 21, otherwise, the month has to be april or may

if (((Month() == 3 && Day() > 21) || (Month >= 4 && Month() <= 5)

//this is a wednessday

&& DayOfWeek() == 3

//in 4 days, it will be a sunday (nigh certain this isn't proper grammar)

&& (Day() + 4 /*makes*/ DayOfWeek() == 0)

//and that sunday will be after day3 (a variable i defined as a day when the moon is full)

> (Day() > day3)))

{

gmonth = day3;

gday = month;

}[/php]

the whole strand together is

[php]

if (((Month() == 3 && Day() > 21) || (Month >= 4 && Month() (Day() > day3)))

{

gmonth = day3;

gday = month;

}
Reason: