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
Thanks Gumrai for your response. Glad it is easier to read now.
The issue is:
As you can see here, it will just go back to IsNewCandle() and just confirm that we are still on the same Bar1Time as before and not actually wait. Basically, if "CheckHistory() == True" then on that specific bar "0" I want NO CODE to run what-so-ever and instead WAIT for "IsNewCandle()" to produce a NEW BAR. On top of this, i then want CheckHistory()==True to be avoided else this code will never progress:
I cannot get this logic down at all... driving me up the wall....
You are doing your best to confuse yourself and me.
return exits a function and may or may not send a value back to where the function was called from.
OnTick is a function that is called by the inner workings of MT4 when a new tick is detected.
Any return within OnTick will return control to the MT4 system that will then wait for a new tick.
It will NOT recall any function that was previously called in OnTick
Using functions can be really useful, but is there really any good reason to use a function to detect a new bar?
Then you present the function
What the hell is low?
what is IsNewBar_Shift ?
It means nothing to us as we do not have full information
Using functions can be really useful, but is there really any good reason to use a function to detect a new bar?
Then you present the function
What the hell is low?
what is IsNewBar_Shift ?
It means nothing to us as we do not have full information
You are right though, I should make it easier to understand! What I am trying to do is above^ but I cannot get it working.
Getting error 130 on OrderSend now and again... I am back-testing within FXCM. I don't understand why as I am trying to use FREEZE_LEVEL as I thought that sometimes my stops and targets can be too close to the current price to send the BUY and SELLSTOPS?
Really appreciate any help or thoughts....
Interesting thank you! That is really helpful, thanks RaptorUK! Was going insane.
I was actually also getting Error 130 due to the fact that my entry price was stored to remain static through-out 1 setup (trade) but not forgetting the entry price under certain rules for the following one after. Instead it would store this same entry price for the next trade and try to enter when price was above or at the BuyStop... Little hard to explain but I think I have it sorted now.
With what you have discovered though, do you think it is appropriate to do exactly what you have said in that link on all my pending orders to be on the safe side: (assuming of course, as you've said, that its a 5 digit broker which mine is: FXCM)?
Interesting thank you! That is really helpful, thanks RaptorUK! Was going insane.
I was actually also getting Error 130 due to the fact that my entry price was stored to remain static through-out 1 setup (trade) but not forgetting the entry price under certain rules for the following one after. Instead it would store this same entry price for the next trade and try to enter when price was above or at the BuyStop... Little hard to explain but I think I have it sorted now.
With what you have discovered though, do you think it is appropriate to do exactly what you have said in that link on all my pending orders to be on the safe side: (assuming of course, as you've said, that its a 5 digit broker which mine is: FXCM)?