amando:
i will check, if i have open an order at the actual bar. My idea is, just ask OrderOpentime() and Time[0] with an Order Select
if ( OrderOpenTime() < Time[0] ) setOrder = true;
The Answer in the jornal at the tester is
2018.01.03 19:23:09.433 2017.10.02 10:02:29 Renko_Risk EURUSD,M1: Opentime: 1506938549 Time: 1506938549
is this only happen with the tester or is this always?
- Your if is checking if you have an order opened before the current bar.
- Your printout says you opened an order, on the first tick if the current bar. Has nothing to do with your if.
- What do you mean "this only happen?" What's the problem?
sorry, you are right, i did a mistake later on,
i wrote
if( setOrder = false &&
instead of
if( setOrder == false&&
courios, MT4 didnt brought an error during compiling
amando: courios, MT4 didnt brought an error during compiling
- Because it's not an error. It's equivalent to setOrder=false; if(setOrder && ... To prevent those types of errors put the constants on the left, e.g. if(0 == ticket)
- You should be able to read your code out loud and have it make sense. You would never write if( (2+2 == 4) == true) would you? if(2+2 == 4) is sufficient. So don't write if(bool == true), just use if(bool) or if(!bool). Code becomes self documenting when you use meaningful variable names, like bool isLongEnabled where as Long_Entry sounds like a trigger price or a ticket number and "if long entry" is an incomplete sentence.SetOrder is sounds like a verb, not question or statement. hasOpenedPreviously is what you're testing.

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
Hello,
i will check, if i have open an order at the actual bar. My idea is, just ask OrderOpentime() and Time[0] with an Order Select
The Answer in the jornal at the tester is
2018.01.03 19:23:09.433 2017.10.02 10:02:29 Renko_Risk EURUSD,M1: Opentime: 1506938549 Time: 1506938549
is this only happen with the tester or is this always?
im using Renko Chart and the offline Chart tester from OVO
https://ovo.cz/products/free-mt4-utilities/offline-test-helper/
in general the Bars have an different open Time