HGB FIFO and Error Traps Thread

EA's inspired by nanningbob's work here, especially those based on his 240 Moving Average trend detection filter.
spgandau
Trader
Posts: 50
Joined: Thu Sep 20, 2012 2:17 am

HGB FIFO and Error Traps Thread

Post by spgandau »

Hello Steve,

you made my day! Your post made me chuckle....Yep, I probably have made it too complicated! :smile:
I will have to re-visit my own"self" and start afresh with a different approach to trade mgmt ideas....

Cheers!
spgandau
Trader
Posts: 50
Joined: Thu Sep 20, 2012 2:17 am

OrdersTotal() not giving expected output

Post by spgandau »

Interesting week of code review:
I have been using FOREX.COM testing Empty4 platform. I have noticed that some trades are not displayed when using OrdersTotal().

I have used a script to enter buystop and sellstop trades. As the EA hits these various entry points, I then begin to monitor them in my trade management routine. Here is the typical code I have been using to find live trades:

Code: Select all

   for(int cc = 0; cc <= OrdersTotal() - 1; cc++)  
   {
      if (!OrderSelect(cc, SELECT_BY_POS, MODE_TRADES) ) continue;
      if (OrderSymbol() != Symbol() ) continue;
      if (OrderType() > 1) continue;  //-- look for live trades only
      ...........
      .............
      <Here is where I would have the EA call subroutines to manage my overall trades of this symbol>
   }
Clearly the idea is to catch only the LIVE trades.

However, I have observed that the EA does not always find every live trade. When I check the journal logs, I see that the pending trades is properly recorded. I also see in the journal log when the pending trade has been triggered and activated. In Empty4 on the TRADES tab, the trade is correctly shown.

HOWEVER, I have observed over several weeks that the EA does not always 'find' every live trade. This is especially true if the individual trades are several hours apart. Why? I am not sure if it is a demo acct issue, if it is the fact that I am testing using WINE on a linux machine, or if the issue is lack of sync between my terminal (my computer) and the server. I would be curious to see if anyone else has had similar experiences?
User avatar
tomele
Administrator
Posts: 1166
Joined: Tue May 17, 2016 3:40 pm
Location: Germany, Forest of Odes, Defending the Limes

HGB FIFO and Error Traps Thread

Post by tomele »

Whining about other platform than GP?
Your post wont last long.
Happy pippin, Thomas :-BD

It ain't what you don't know that gets you into trouble.
It's what you know for sure that just ain't so.
(Mark Twain)

Keep the coder going: Donate
User avatar
SteveHopwood
Owner
Posts: 9754
Joined: Tue Nov 15, 2011 8:43 am
Location: Misterton - an insignificant village in England. Very pleasant to live in.

HGB FIFO and Error Traps Thread

Post by SteveHopwood »

I just googled "FOREX.COM" and see what Thomas means. Usual stuff: lots of flashy colours and promises etc. I stopped being attracted by that stuff a long time ago. So did the rest of us with the occasional firing synapse.

Global Prime are not SHF's 'Official Broker' because they offer me a gazillion pounds every time I utter their name. They are SHF's broker (and incidentally the only broker I trade with) because they are a genuine broker: http://www.stevehopwoodforex.com/phpBB3 ... =52&t=1475 The rest of 'brokers' are mostly criminals.

So something that works seamlessly elsewhere such as GP yet fails when applied to your chosen criminal? Try Global Prime. At the very least, change to a different non-GP criminal. If you do not know why I refer to most forex so-called 'brokers' as Criminals then you clearly have not been taking notice here and deserve all the pain that the path your are following is leading you down.

Not allowed to open an account with GP? Sorry, but you are stuffed. Having said that, Bob must be tradimg with someone. Just no idea with whom.

Or maybe you think you have spotted something about Empty4 that The Brains here have missed? I doubt it.

:xm: :rocket:
Read the effing manual, ok?

Afterprime is the official SHF broker. Read about them at https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?p=175790#p175790.

I still suffer from OCCD. Good thing, really.

Anyone here feeling generous? My paypal account is always in the market for a tiny donation. [email protected] is the account.

To see The Weekly Roundup of stuff you guys might have missed Click here

My special thanks to Thomas (tomele) for all the incredible work he does here.
spgandau
Trader
Posts: 50
Joined: Thu Sep 20, 2012 2:17 am

HGB FIFO and Error Traps Thread

Post by spgandau »

SteveHopwood » Sun Mar 25, 2018 6:30 pm wrote:I just googled "FOREX.COM" and see what Thomas means. Usual stuff: lots of flashy colours and promises etc. I stopped being attracted by that stuff a long time ago. So did the rest of us with the occasional firing synapse.

Global Prime are not SHF's 'Official Broker' because they offer me a gazillion pounds every time I utter their name. They are SHF's broker (and incidentally the only broker I trade with) because they are a genuine broker: http://www.stevehopwoodforex.com/phpBB3 ... =52&t=1475 The rest of 'brokers' are mostly criminals.

So something that works seamlessly elsewhere such as GP yet fails when applied to your chosen criminal? Try Global Prime. At the very least, change to a different non-GP criminal. If you do not know why I refer to most forex so-called 'brokers' as Criminals then you clearly have not been taking notice here and deserve all the pain that the path your are following is leading you down.

Not allowed to open an account with GP? Sorry, but you are stuffed. Having said that, Bob must be tradimg with someone. Just no idea with whom.

Or maybe you think you have spotted something about Empty4 that The Brains here have missed? I doubt it.

:xm: :rocket:

Hello Steve,
Many months ago, based on your recommendation, I went to GP's site to tried to open an account. They don't deal with US customers...so I am stuck. I will keep looking for a broker. Thanks for the input and your looking at this!
Cheers
spgandau
Trader
Posts: 50
Joined: Thu Sep 20, 2012 2:17 am

HGB FIFO and Error Traps Thread

Post by spgandau »

EA version "e" is up. I also included an updated flow logic diagram. no major changes, but some items have been removed, one or two small items added.

Research comment (for US trader using Forex.com and / or Oanda);
I have been trying to solve an issue where the EA would not always correctly 'find' live trades when using Orderstotal() and OrderSelect(). I thought it was Forex.com trying to be difficult. I then moved to Oanda and tried their Empty4 platform. Similar results. After talking with both tech support systems, I discovered that there is very little good in-depth support for Empty4. Both operations have their own proprietary material that they support heavily. Empty4 is allowed to exist there, but no high quality support. When I explained my question to both systems, they told me to go to mql.com. Empty4 is now deprecated in the mql.com world, and most support is for MT5. Difficult to get good answers for my Empty4 question.

Eventually, I tried a test. The log file for scripts resides outside the Empty4 folder. The log file for EA commands resides inside the Empty4 folder. I wondered if that would cause a difference in the way that Empty4 'received' and recorded pending trades. I normally use a script from the scripts section to send pending trades. Then, I normally let the EA run and manage the pending trades...and create new ones as it sees fit.

I began to suspect that if the EA sends a pending trade, Empty4 at the server end processes it differently than if a script is used. I can see all pending trades when they are opened in the scripts log file that resides outside the Empty4 folder. I can also see when that pending trade is activated (gone 'live'). What has surprised me is when the EA does not 'find' that activated trade in Orderstotal(). However, if I use OrderSelect(...) by order number it will find that trade, but not if I use Orderstotal()....and select by position.

So, I made some changes in how Orderstotal() is used in the for...loop. I also adjusted my EA to auto order pending trades each bar (4 hours). With the EA making pending orders, as they go 'live' I want to see if Orderstotal() will 'find' all those lives trades. This will take a couple of weeks I will let you know what I learn.
I am a US trader that is limited in my access to a good broker, so this is my attempt to help the other US trades who face similar issues.

NOTE: the copy of the EA that I posted is set to auto order at the beginning of each bar.

Cheers!
spgandau
Trader
Posts: 50
Joined: Thu Sep 20, 2012 2:17 am

HGB FIFO and Error Traps Thread

Post by spgandau »

I have been a long time out, testing. It has been slow.

version N is up.

I still suspect Empty4 and how it deals with orders entered by scripts. (This is for those US traders still struggling with US brokers who provide Empty4, but do not get truly good support for Empty4 by the broker).
I have often used a script to places a series of pending trades. The script functions properly, and correctly inserts pending(s) order on the screen and in the Logs folder OUTSIDE of the Empty4 folder. The broker will properly activate those pending trades.

However, the EA may, or may not, keep track of those pending trades....and often does not recognize when those pending trades are activated and become live trades.

So, I have begun making trades using only the EA to create the pending trades. I am testing to see if the EA will correctly recognize pending trades and then correctly monitor those pending trades when they are activated and become live trades..... TBD.

Cheers!
Big Be
Trader
Posts: 52
Joined: Thu Nov 01, 2012 6:12 pm

HGB FIFO and Error Traps Thread

Post by Big Be »

spgandau,
Did you get this resolved??
"Big Be"
spgandau
Trader
Posts: 50
Joined: Thu Sep 20, 2012 2:17 am

HGB FIFO and Error Traps Thread

Post by spgandau »

Big Be » Thu Mar 26, 2020 2:05 pm wrote:spgandau,
Did you get this resolved??
Not to my Satisfaction. I did think that the issue was internal to Empty4, so I chose to keep all transactions recorded did inside the EA, I did not rely on the trade log
Post Reply

Return to “Thingy Bob EA's”