[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 280

 
Roger:


You can try it like this

Honestly, I haven't tried it myself.


Well, yes, only StringLen(str) will probably shift the descriptor by the length of the string, but from the end (i.e. from a new string) of the string...

 
BBSL:


Well, yes, only StringLen(str) will probably shift the descriptor by the length of the string, but from the end (i.e. from a new string) of the string...


Sorry, I don't get it. :-(
 
Sergey_Rogozin:

The script is up and running. Thank you.

Result: outputs bar numbers with arrows, but writes that buffer values = 0.0000000

Herewe go!!!

.........................................

I'll save it for later. That's enough for today.

It's not going well...


To the island!!! :)

 
Roger:

Sorry, I don't get it. :-(


See, if we do FileClose(p);

And then, FileSeek(p, (any positive value), SEEK_END);, then we shift the descriptor to (any positive value), but from a new line, I think so... So maybe we should take FileSeek(p, -1, SEEK_END);; and check it, maybe it will work...

 
FileClose() is too early, put it at the end. FileSeek, if set to SEEK_END, counts from the end.
 
Roger:
FileClose() was put too early, put it away. FileSeek, if SEEK_END is at the end, counts from the end.


It won't work like this...

I mean, I can't do that by the logic of the program...

To add a piece of data, must be from the other end of the program, which is called once every n ticks

And it is not nice to keep a thread open...((

I think FileSeek(p, -1, SEEK_END); will work, I'll try it in a couple of hours))

 

Hi all again. Can you advise me, I am running the following code. The program manages to place several orders (on the tester) before it finds an order and puts a flag. Is this a feature of the tester? I meant that the code is executed linearly. What is the trick here? Thanks in advance, friends!


for(int i=1 ; i <= OrdersTotal() ; i++)
   {
   if(OrderSelect(i-1,SELECT_BY_POS,MODE_TRADES))
      {
      if(OrderOpenPrice()-(p1+more) == 0)
         {
         ordersethigh1=true;
         break;
         }
      }
   }
     
if((ordersethigh1==false) && (p2-price>pointsclose))
   {
   OrderSend(Symbol(),OP_SELLLIMIT,baselot,p1+more,3,NULL,NULL,"Comment",0001,0,White);
   }
 
Pyro:

Hello again everyone. Can you advise me, I am running the following code. The program manages to place several orders (on the tester) before it finds an order and puts a flag. Is this a feature of the tester? I meant that the code is executed linearly. What is the trick here? Thanks in advance, friends!




The trick is that the condition is almost never satisfied. Put <=Point*0.5 instead of ==0 and life gets better. Oh, and the modulus of the difference on the left-hand side.
 OrderOpenPrice()-(p1+more) == 0
 

tara


It's interesting, because my order setting price is normalised to 4 digits, i.e. fractions of a pip cannot be there. Why is it so? And yes, it is working properly now! THX

 
Pyro:

Hello again everyone. Can you advise me, I am running the following code. The program manages to place several orders (on the tester) before it finds an order and sets a flag. Is this a feature of the tester? I meant that the code is executed linearly. What is the trick here? Thanks in advance, friends!

The code I sketched out for you on page 277 (penultimate post on the page) didn't fit your problem?

It's with checks and normalization.