Trade execution for gold and US30

 
hi programmers can anyone hep me out with the mqltraderequest order for opening positions in gold and us30, i am kinda stuck in the implementation since i have only dealt with forex eas. I'd really appreciate the help.
 
Edwin Tempah: hi programmers can anyone hep me out with the mqltraderequest order for opening positions in gold and us30, i am kinda stuck in the implementation since i have only dealt with forex eas. I'd really appreciate the help.

It is basically the same as any other symbol. Show your code attempt.

 
Fernando Carreiro #:

It is basically the same as any other symbol. Show your code attempt.

okay i haven't actually written it since im still confused on what to change from the forex ea but these are my eas, do you mind pointing out the tweaks i should make

Files:
 
Edwin Tempah #:

okay i haven't actually written it since im still confused on what to change from the forex ea but these are my eas, do you mind pointing out the tweaks i should make

So run it against gold and US30 in the Strategy Tester and see what happens. Take note of any errors or inconsistencies and see if you can understand what changes.
 
Fernando Carreiro #:
So run it against gold and US30 in the Strategy Tester and see what happens. Take note of any errors or inconsistencies and see if you can understand what changes.

i have but not a single trade is executed

 
Edwin Tempah #:i have but not a single trade is executed

So add debugging "prints" to your code to see what is happening. You can't expect us to go through all your code and analyse and debug it for you.

What I can say from the quick look I did, is that your code is not even safe for forex trading — it does not check the symbol's tick size properly, and doesn't check the Stops Levels, or the allowable trading times, or the allowable volume, etc.

So, what I am saying, is that you first need to fix all those things even for Forex, which in turn will help you make it safe for other symbols too.

Reason: