Forum

getting height of window in pips

I need to know the height of the main chart window in pips or pixels, so I can place objects at just below the top of the chart window

too many orders at once

it seems for some reason when I back test my strategy I get several orders per minute. It is just a simple stop and reverse system based on a double moving average crossover. 28 2007.09.17 04:27 close 14 1. 00 1. 3871 0. 0000 0.0000 -30. 00 9244. 70 29 2007.09.17 04:27 sell 15 1.00 1.3871 0.0000 0

Use the MA from the chart

I am trying to get a variable for a 50 minute simple moving average, the one that appears on the chart when I apply it to one. I am using: double MoveA = iMA (NULL,PERIOD_M1,50,0,MODE_SMMA,PRICE_MEDIAN,0); When I use the print function to print out MoveA, it is never very far away from the current

ldrawing lines on visual backtest window

Trying to find examples of how to add simple graphics to the chart window that is displayed when backtesting in visual mode. The graphics would be very similar to a custom indicator . I cannot seem to find this info anywhere in the MT4 or MQL4 help files. Thanks

Backtesting help

Can't figure out why this code won't backtest properly. The backtest runs, but no results and no trades occur. The code seems correct to me. Anybody have any ideas? int start () { double PosHigh = High [ iHighest ( NULL , 0 , MODE_HIGH , iBarShift ( NULL , 0 , OrderOpenTime ()) , 0 )] ; int ticket =

Closing the open position

I have some real basic code here but I can't seem to get it to work because I do not know how to get the ticket number from current or open order. int start(){ double buyhigh = High[iHighest(NULL, 0, MODE_HIGH, iBarShift(NULL, 0, OrderOpenTime()), 0)]; if (Close[PERIOD_M1] > Open[PERIOD_M5])

How to find highest price after buy

Is there a built in way to do this with MQL? Something like, high(openorder)? Or do I have to get in the mess of setting up dynamic arrays

Basic Code Syntax

Hello all. I am trying to develop a basic MQL expert advisor for fully automated trading . I have looked around and haven't found very many tutorials on how to write EAs. Below I have attempted to write a simple EA, but am not sure about the syntax. int ilots = 100 //open position //if no other