You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
1. Can you attach "Center Of Gravity Oscillator" CI ?
2. Assign your iCustom to a variable, it will make your code more readable.
Phi.nuts,
See attached Center of Gravity Oscillator; I need explicit instructions for assigning the icustom to a variable to make it more readable.Thanks for your reply.
Phi.nuts,
See attached Center of Gravity Oscillator; I need explicit instructions for assigning the icustom to a variable to make it more readable.Thanks for your reply.
Thank you for the attachment, actually you can attach the .mq4 file which also can be opened on notepad.
Your iCustom call is wrong. Here's parameters in iCustom that we need to fill
So, for example your iCustom call should be like this :
Off course you can put in the extern input directly inside iCustom, like this :
In your code, you only write 2 extern input, while actually, there are 3 :(, you forget the "----- Typical or Median --------------" one.
Second mistake you've made is, that there are 2 buffers in CGO, they are buffer 0 and 1, yet in your code your write for buffer number 2 - which is third buffer in CGO.
Seem like you coding for position opening is the same for closing opposite position. In this case, we can write the all those codes in one place, but you have to search first if there's already opened position before closing or opening position.
I didn't test these code in MT nor compile it, so there may be some errors :D.
It may good idea to answer RaptorUK request for your OrderSend/Close codes
Thank you for the attachment, actually you can attach the .mq4 file which also can be opened on notepad.
Your iCustom call is wrong. Here's parameters in iCustom that we need to fill
So, for example your iCustom call should be like this :
Off course you can put in the extern input directly inside iCustom, like this :
In your code, you only write 2 extern input, while actually, there are 3 :(, you forget the "----- Typical or Median --------------" one.
Second mistake you've made is, that there are 2 buffers in CGO, they are buffer 0 and 1, yet in your code your write for buffer number 2 - which is third buffer in CGO.
Seem like you coding for position opening is the same for closing opposite position. In this case, we can write the all those codes in one place, but you have to search first if there's already opened position before closing or opening position.
I didn't test these code in MT nor compile it, so there may be some errors :D.
It may good idea to answer RaptorUK request for your OrderSend/Close codes
phi.nuts,
Thanks for your reply; I will review today and post my findings asap. I read through the icustom section yesterday after reading your first reply but it is hard to find a solution to a problem when you are unaware of exactly what the problem is , thanks again for helping me facilitate the learning process.
It probably is . . . but it is not the code that places the Orders. If your print output to the log agrees with the trades that are being taken then the issue may not be with the code that actually places the orders . . .
Raptor,
I believe this is what you were asking for :
Raptor,
I believe this is what you were asking for :
Yes and no . . .
It shows the Buy()and Sell() functions but your code is convoluted so we still don't get to see the actual functions that do the OrderSend().
Your ExecuteOrder() and ExecuteECNOrder() functions take exactly the same parameter so they could easily be one function whose behaviour is determined by the value of isECN, this one function would also take the place of your Buy() and Sell() functions . . . you pass the order type to ExecuteOrder() and ExecuteECNOrder() so there is no need for the Buy() and Sell() functions . . . if you want to provide the code for all these functions I'll show you what I mean.
Why does this function call another function twice . . .
I suspect it may well be because the function CloseAllPositions() is coded incorrectly and has a loop that counts up instead of down, this means it will not close all Orders and hence the need to call it twice . . .
If I am correct this will help: Loops and Closing or Deleting Orders
phi.nuts,
Thanks for your reply; I will review today and post my findings asap. I read through the icustom section yesterday after reading your first reply but it is hard to find a solution to a problem when you are unaware of exactly what the problem is , thanks again for helping me facilitate the learning process.
phi.nuts,
I have made some significant changes over the past month. I didn't code this exactly as you had indicated previously ( there are numerous ways to achieve the same outcome ). Attached is the code in its entirety along with the oscillator code. I don't believe results from the strategy tester are very accurate so I have been forward testing on a live demo account. Those results vary a great deal and do not make sense.I'd appreciate any insight you may be able to provide.
Richard
phi.nuts,
I have made some significant changes over the past month. I didn't code this exactly as you had indicated previously ( there are numerous ways to achieve the same outcome ). Attached is the code in its entirety along with the oscillator code. I don't believe results from the strategy tester are very accurate so I have been forward testing on a live demo account. Those results vary a great deal and do not make sense.I'd appreciate any insight you may be able to provide.
Richard
phi.nuts,
Sorry, the EA code didn't make it first time....
phi.nuts,
I have made some significant changes over the past month. I didn't code this exactly as you had indicated previously ( there are numerous ways to achieve the same outcome ). Attached is the code in its entirety along with the oscillator code. I don't believe results from the strategy tester are very accurate so I have been forward testing on a live demo account. Those results vary a great deal and do not make sense.I'd appreciate any insight you may be able to provide.
Richard
You should make your code more readable, so it's easy for everyone to study your code.
So instead using
You can use
I have to go though MarketInfo's Standard Constant, just to find out what is 14 in MarketInfo.
Your iCustom call is also wrong, the first parameter of iCustom is string, yet you put in an integer, and other parameter of iCustom is indicator extern input. It's better to write those inputs in iCustom so you can change the indicator input right from the EA and the EA also won't be disturbed when the default input parameter in indicator is changed.
You should make your code more readable, so it's easy for everyone to study your code.
So instead using
You can use
I have to go though MarketInfo's Standard Constant, just to find out what is 14 in MarketInfo.
Your iCustom call is also wrong, the first parameter of iCustom is string, yet you put in an integer, and other parameter of iCustom is indicator extern input. It's better to write those inputs in iCustom so you can change the indicator input right from the EA and the EA also won't be disturbed when the default input parameter in indicator is changed.
phi.nuts,
Thanks for your reply and assistance; I'll review the icustom again........