The difference between the order ticket number on the real hedging account and demo hedging account MT5 - page 2

 
Vladimir Karputov:

Where? I have not seen your MQL5 code.

please scroll up

code

 
Sugianto :

please scroll up

It's just a piece. This is not a code, but a piece of a program.

There is no variable initialization in the provided stub ...

 
Vladimir Karputov:

It's just a piece. This is not a code, but a piece of a program.

There is no variable initialization in the provided stub ...

but this is the code I use for tracking ticket.


The others are not related to tracking tickets.


With the same code, tracking results can differ between demo and real

 
Sugianto :

but this is the code I use for tracking ticket.

The others are not related to tracking tickets.

With the same code, tracking results can differ between demo and real

All the code is needed to show your error.

I am not a telepathic person, but I suppose: you do not initialize variables, you do not reset variables, you confuse price and ticket, you confuse up and down. But this is all I only assume - since you did not show all the code.

If you do not show the entire code, then you will be left alone with your mistake.

 
Vladimir Karputov:

All the code is needed to show your error.

I am not a telepathic person, but I suppose: you do not initialize variables, you do not reset variables, you confuse price and ticket, you confuse up and down. But this is all I only assume - since you did not show all the code.

If you do not show the entire code, then you will be left alone with your mistake.

Thank's Vladimir, The problem of confusion about up and down, if that's the problem I just question why the results on the demo account can be the same, while on the real account it can be negative, even though it uses the same code.


by the ways, if you want to see the complete code, I use the reference from this https://www.mql5.com/en/code/27440

VR Smart Grid Lite MT5
VR Smart Grid Lite MT5
  • www.mql5.com
The EA uses large volume orders to partially close other orders, with this approach, the breakeven and profit price is much closer to the current price than if you use all orders in the terminal or their full volumes.
 
ok, I've solved the problem.

I only changed the following 1 line code:


tk=(int)m_position.Ticket();

CHANGE TO:

tk=m_position.Ticket();

Thank's Vladimir dan Amando for Already taking the time to discuss with me on this topic, I wish you always healthy and prosperous

 
Sugianto :

Thank's Vladimir, The problem of confusion about up and down, if that's the problem I just question why the results on the demo account can be the same, while on the real account it can be negative, even though it uses the same code.


by the ways, if you want to see the complete code, I use the reference from this  https://www.mql5.com/en/code/27440

You gave a link to clean code. I want to see your dirty code - the code in which you made mistakes. You obviously made some changes, but you made a bunch of mistakes.

My advice: fix all your mistakes. And post your code.

 
Sugianto :
ok, I've solved the problem.

I only changed the following 1 line code:


Thank's Vladimir dan Amando for Already taking the time to discuss with me on this topic, I wish you always healthy and prosperous

This is just one mistake. Here's another error:

 if((m_position.Symbol()==Symbol()||m_position.Symbol()==SubSymbol) && m_position.Magic()==EAmagic)

and I think you have made mistakes in many places.

 
Vladimir Karputov:

This is just one mistake. Here's another error:

and I think you have made mistakes in many places.

Thank you Vladimir, I have corrected the mistakes you pointed out.

And frankly, I didn't think that adding (int) would change the result between demo and real.

It would be nice if the demo account can run properly and it should be on a real account. The consistency between real and demo should be the same.

So if the demo doesn't work, it's the same in real, and vice versa.

Due to the inconsistency between demo and real results that makes many people doubt an expert advisor.

Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Account Properties
  • www.mql5.com
Account Properties - Environment State - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Sugianto :

Thank you Vladimir, I have corrected the mistakes you pointed out.

And frankly, I didn't think that adding (int) would change the result between demo and real.

It would be nice if the demo account can run properly and it should be on a real account. The consistency between real and demo should be the same.

So if the demo doesn't work, it's the same in real, and vice versa.

Due to the inconsistency between demo and real results that makes many people doubt an expert advisor.

You still haven't understood anything: trade servers work WITHOUT ERRORS. And here you write with ERRORS. That is, the problem is in you. Remember: this is a technical forum and if you are trying to blame MetaQuotes - be prepared to prepare hard evidence.

Reason: