Forum

Testing Code and found OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES) does not change

Testing Code and found OrderSelect(Ticket,SELECT_BY_TICKET,MODE_TRADES) does not change after selected ticket is closed. Anyone know the reason? extern int Ticket= 0 ; //+------------------------------------------------------------------+ //| expert initialization function

How to use Zigzag values to make custom ATR indicator

The following code for an indicator just kept crashing / suspending (infinite loop, too many calcultion???) Can someone suggest a better coding practise to get a better result. Code is not tidy as it has been copy and pasted from different places and played with to see if I can get a quick overview

Should programers adjust for 5decimal place brokers?

I have noticed that there is an assumption that Expert Advisers accept their inputs as if they are meant for 4decimal place brokers. There also seems to be the assumption that programmers should assume Users will assume that the inputs like Take Profit are going to be in measures of 4 decimal

Methods of Recovery after deinit() - got any ideas?

I am trying to finish an EA that watches manually placed trades with enough protection built in to prevent stupid errors on use. Got to the deveopment area of protecting against use of Period Change the F7 key and schedualed computer restarts. So no magicnumber. Situation to cope with is same symbol

Advise on saving stuff to a file.

Life gets a LOT more interesting when you start saving values to a file. 1) take care of EA working on more than one chart. 2)File maintenance. In issue one - New file for each new ticket identified by ticket number or Maintan one file with each line holding ticket data. Many files - have to find

Response to FAQ I want an EA to Close order at TakeProfit and StopLoss

I believe I have seen this request a few times so with my best programmers hat on I have written the following, yet to test it on demo account criticisms please Note it was written for clarity not efficiency - I'll screem if you also ask for it to place a trade at price :-) (maybe I will add that

Scripts and Indicators bacause?

Just checking. A script file is a script file because it is stored in the scripts folder? True or False Is the same true of a indicator? True or False or Defined by its #property definition. Script files dont accept extern values? True or False or Well there is another way. Appologies for not

MT4 now not saving toolbar, Navigator and other view settings

What do I need to delete or reset to get the current build of metatrader to save all it current display settings so that when I close and open MT4 I still see all the toolbars and navigator windows setting I had when I closed MT4

When is :- If(Bars !=BarCount)

I have been reading through some code in the codebase and came across //+------------------------------------------------------------------+ //+------------------------------------------------------------------+ extern bool EachTickMode = False; int BarCount; int Current; bool TickCheck = False;

Simple EA into sub window indicater - How?

How can I turn this simple EA into an indicator - results either in main window or sub window. //+------------------------------------------------------------------+ //| MarketInfo.mq4 |