[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 299

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
//-----------------------------------------------------------------------------+
//Kim Respect and respect !!! |
//+----------------------------------------------------------------------------+
This was undoubtedly the most stressful part of the code))))
Okay. I don't understand a thing. I got the second TF up and running. Everything should be running like clockwork. But it doesn't. No, it's working, but it's not as expected. Checked it a thousand times. I do not see any syntactic or algorithmic errors myself. Let me try to explain. I'm attaching the full code. So:
In the beginning of start() I put a handler for the number of seconds passed since the last start(). Repeated sections were moved to user-defined functions. The new value time=TimeCurrent() is assigned there, in user functions.
The function works in two modes: in the first branch, AtFirst=true, it only catches a tick and pre-zeroes the array-storage, while in the second branch, AtFirst=false, it works exactly as a tick store. That is, we either zero out and truncate the drive and catch the bid-ask in a zero cell, or lengthen the drive and catch the bid-ask. Alert was set only for debugging purpose. I will describe the condition of zeroing of the accumulator further on.
The function of 'drawing' the candle (adding a candle to .hst opened in the autonomous chart). Similarly - I put alerts for debugging. The first alert signals at two caught ticks in one second (array size is equal to two, and in idea the volume should be equal to two), while the second one signals at bit equal to ack in the caught tick (similar alert in drive: but they work non-synchronously for some reason), and the volume of candlestick. This is all in theory, in fact, when entered into file (by alert), for example, two (or 0x00 00 00 00 00 00 00 40, double 2.0) it somehow still turns out to be one (0x00 00 00 00 00 00 F0 3F, double 1.0 in BigEndian format). I usually override that alert in the drive, it beeps often, I work with these two.
The function "draws" a dash in case there was no tick in what second. It works according to the following algorithm:
Δtime=0: catch (copy) ticks.
Δtime=1: Draw a candlestick on the tick that was caught before, then catch the tick (with a preliminarily zeroed accumulator).
Δtime>1: Draw a candle on the tick caught before, draw dashes on the Close[0] line in the amount ofΔtime-1, catch a tick (with preliminarily zeroed accumulator). In all cases the accumulator should be zeroed when a candle is already drawn on it and it means that the accumulator is not needed anymore. This happens whenΔtime>0.
Let's run it through:
With the arrow I have drawn the moments where the bid is supposedly equal to the asc and the volume should be supposedly equal to one. I did not capture the bottom with volumes, you can't see anything there anyway, it's shallow. But they are all level, i.e. either zero or one, none goes up to two (although the alert is signalling). Two ticks per second - still at a mouse hover ironically shows volume = 1, and the bid is equal to asku also ironically shows volume = 0. Why? I understand that somewhere is an error, but most likely I do not notice the error, or look in the wrong place. I am attaching the code, I've commented out my part of the code well, checked indents everywhere, removed inluders, just selected functions to be used, so that it would compile faster. The only one remark - it doesn't work offline, i.e. with TimeLocal, unlike original tick collector, because I've written in if(tickTimeLocal==true) there from the scratch (as I didn't need it much). I tried to translate it into Expert Advisor following Taras' advice - candlesticks are not shown in autonomous chart (but current quote's line is moving well).
your slippers.
Hello
Here's a question. Let's say today is Monday. I need to know the closing price on Friday. I need to know the closing price on Friday.
I asked this question because I see the Saturday and Sunday bars in the Strategy Tester. I have not traded on these days. Above written line is the closing price on Friday or Sunday?Hello
Here's a question. Let's say today is Monday. I need to know the closing price on Friday. Can I write
I got this question because in the Strategy Tester I see bars on Saturday and Sunday. I did not trade on those days. Above written line gives the closing price on Friday or Sunday?Give me Friday's price! If the server closes no later than 24.00 on Friday and starts no earlier than 0.00 after Sunday!
Use the DailyPivotPoints indicator!
Nah, I don't understand it at all. Clearly already writing
At the alerts equal to 2, I take the indicator off the minutes, I drag the mouse over the candlestick... Volume=1.
Looked RateInfo in hst through FileInsight (like debugger), I think maybe there int, but not double in Volume - no, same-double...
Good evening.
Thanks for the reply to my question))
Please tell me if I open a Buy order like this OrderSend (Symbol(),OP_BUY,Lot,Ask,3,0,0, "Buy",0,0,Green);
If it is a sell orderOrderSend (Symbol(),OP_SELL,Lot,Ask,3,0,0, "Sell",0,0,Red);
is the difference blue or does it need to change the red colour as well? i.e. where OP_BUY is the Bid price
where OP_SELL has the Ask price
I also wanted to check if my order hasn't changed and I didn't want to change it, so why is it OK in the Strategy Tester, but in the REAL "Error when opening order 129" - please, help!
Good evening.
Thank you for answering my question))
Please tell me if I open a Buy order like this OrderSend (Symbol(),OP_BUY,Lot,Ask,3,0,0, "Buy",0,0,Green);
If it is a sell orderOrderSend (Symbol(),OP_SELL,Lot,Ask,3,0,0, "Sell",0,0,Red);
is the difference blue or does it need to change the red colour as well? i.e. where OP_BUY is the Bid price
where OP_SELL has the Ask price
I also wanted to check if my order hasn't changed and I didn't want to change it, so why all went well in the Strategy Tester and in the Demo, but I got an error of 129 when I tried to open it in the REAL Market?
Good evening.
Thank you for answering my question))
Can you tell me if I open a Buy order like this OrderSend (Symbol(),OP_BUY,Lot,Ask,3,0,0, "Buy",0,0,Green);
If it is a sell orderOrderSend (Symbol(),OP_SELL,Lot,Ask,3,0,0, "Sell",0,0,Red);
...Sell:
I recommend updating quotes before sending an order:
RefreshRates(); OrderSend (...);
And note that your slipage =3, for 4-digit quotes will be =3 pips and for 5-digit quotes it will calculate as 0.3 pips. So if your EA is going to work with 5-digit quotes, then set slipage = 30.Nah, I don't understand it at all. Obviously I'm already writing
At the alerts equal to 2, I take the indicator off the minutes, I drag the mouse over the candlestick... Volume=1.
Looked RateInfo in hst through FileInsight (like debugger), I think maybe there int, but not double in Volume - no, same-double...
Looked at your code.... You got it all too confused))))
I don't quite understand, why we need to accumulate ticks, because it is enough to store in memory (or even not to store, because the current bar must be written in HST - otherwise the chart won't be updated) parameters of the current bar - six numbers TOHLCV, and to update them as needed at tick receipt, and to make bar cutoff at specified condition(TimeCurrent()-O>1).
Try to rework the code this way, it will be reduced by 8 times, I guarantee it (I've checked it:)