if(CopiedTime == -1)
Thank you!
but still it doesn't print this line on new bars:
Print("We have new bar here ",New_Time[0]," old time was ",Old_Time," higest price: ",p_high[0]," lowest price: ",p_low[0]," Close price: ",p_last[0]);
I assumed that the copiedtime was to blame for it, and wrote a wrong error check...
Do you happened to know why isn't it print out the data?
Thank you!
but still it doesn't print this line on new bars:
I assumed that the copiedtime was to blame for it, and wrote a wrong error check...
Do you happened to know why isn't it print out the data?
It's only printed in debug mode :
if(MQL5InfoInteger(MQL5_DEBUGGING))
Are you running it in debug mode ?
Guess I didn't...
I moved the Print line up, but then it spams the data on every thick, shouldn't it only Print it on new bar?
do i mess it up with this somehow? (TimeCurrent?)
Edit: sorry I'm a bit tired, I have to do idiotic universitiy burocracy on the side all day + this.
Yes naturally with TimeCurrent it will take every tick as a newbar....
static datetime Old_Time = TimeCurrent(); datetime New_Time[1];
Can you just tell me if you think my buy and sell conditions should be working? (in my test sometimes it tries to buy while P_high =/= with p_close)
I have no idea why is that, do I gave to many && to the if?
SellCondition && IsNewBar && !Sell_opened && !First_tick
Same with buy, just with buycondition....
ps.: first tick was implemented to avoid first tick buys
Can you just tell me if you think my buy and sell conditions should be working? (in my test sometimes it tries to buy while P_high =/= with p_close)
I have no idea why is that, do I gave to many && to the if?
Same with buy, just with buycondition....
ps.: first tick was implemented to avoid first tick buys
Same error...
bool BuyCondition = (p_high[1] == p_last[1]); bool SellCondition = (p_low[1] == p_last[1]);
Same error...
Jesus... thanks, I have the same feeling when I started to learn programing myself, I should never stoped if I know that I forget everything this quickly...
Thank you
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello, I try to develope my first ExpertAdvisor, but just as I solve a problem another seems to pop up.
Now It seems I have a problem with my CopyTime and I just dont understand where and why, in the noon it worked...
code:
I get Copy time fail! and an error
ERR_TRADE_POSITION_NOT_FOUND
4753
Position not found
I'm about to start over my entire codeing because I start to lose myself in what does what (I had problems with arrays before, maybe a clean slate would help, but I just cannot leave it yet..)
Even if the copytime somehow would succed it seems my code would try to buy!! but it shouldn't (1==2) right? In the comment after that you can read my original conditions. My goal was to identify new bars where the p_close is = with p_highest or p_lowest, assuming that if thats the case there is a down or up trend respectively and buy or sell accordingly. I have a feeling that I over cmplicate it a "little"....
Do you guys have ny idea what do I do wrong? (Im testing in a demo server)
any help is welcome... sorry for the spagethi code