Forum

Refreshed Rates and Looped Trying But Still OrderSend error 129

I am consistently getting an OrderSend error 129 for invalid price on my EA. The same EA is running on several pairs, for most of them it works fine, but there a few pairs that consistently get errors when trying to open a trade. I am refreshing the rates before sending the order, and if the order

Is there a way to for loop through a CArrayObj?

I'm curious if there is a way to for-loop through a CArrayObj or CList? Also, is there a way to get the number of objects within a CArrayObj or CList? I've thought of work arounds like having a counter that I increments every time I add to the list, but just curious if there's a standard way

Wront Parameter Count for constructor, but I have the same number of parameters

I'm trying to just make a basic Object, but I'm getting an error saying the parameter count is wrong, but it seems the number of parameters in the object creation are the same as in the constructor, so I don't know why I'm getting this error

MQL4 documentation webrequest example creates file, but with no text

I'm trying to just run the example code found in the MQL4 documenation for webrequest. I believe the code should connect to a website, pull the code, and write it to a file. When I execute the script I see a file appear, so it does get created, but there's not text in it, so possibly something wrong

Simple Trade Opening Script

I'm trying to work with MqlTradeRequest to make a simple script that just opens an order. I simply copied and pasted the script from the mql documentation, but it's not working for me. The MqlTradeRequest and MqlTradeResult don't highlight pink when I type them. I'm getting lots of errors, I imagine

Object Oriented Approach to MQL

I was trying implement an object oriented approach to my EA's. I know basic OOP programming in Java, but the only C++ I know is from writing basic EA's in MQL4. I wrote a short test script just to understand the basics first, I just want it to open a trade based on a condition. The condition I've

very strange problem

Hi All, I seem to be having a very strange problem with metatrader, i don't know if it's my broker or what, but i can't begin to imagine what it is. I have an EA that works sometimes, but not others. I wrote it myself so i know what's in it. I put it on and it might open the 2 pending orders it's

Hopefully simple/quick question about OrderClose()

Hi, I'm trying have an open order close, but i get an error saying "invalid lots number for OrderClose function ." The same happens for the ticket, "invalid ticket number", unless i save the order as a variable. I imagine there's something obvious that I'm missing and would really appreciate any

For Loop not Deleting Both Orders (Yes, the loop is Decrementing)

Hi, I'm trying to open a buy and a sell order then delete them if they don't open in 40 seconds. The loop is decrementing, but only the sell stop order deletes. I can't figure out what I'm doing wrong. Here's my code: double sell_ticket; double buy_ticket; int TotalNumberOrders = OrdersTotal