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

 
rigonich:

Would you learn to ask the right questions? What lines? Power lines? Most people aren't telepathic and can't know what you mean unless you tell them.
I'm a telepath! What's wrong? :-))
 
lottamer:

why do I have a string of conditions

if (cmd999==OP_SELL && Stoch_1>Stoch_2 && OrderProfit()>10)

is executed as TRUE even if OrderProfit is less than 10 (dollars) ?

After all, everything less than 10 dollars should be cut off?


Try to print variables before this line, maybe your program does not reach this line, or variable values are not what you expect. For example, if you have a cent account,OrderProfit() function in some brokerage companiesreturns the value in cents, and in others - in dollars.
 
rigonich:

Try to print variables before this line, maybe your program does not reach this line or variable values are not what you expect. For example, if your account is cent, OrderProfit() function returns value in cents in some brokerage companies and in dollars in others.


1 - the program cannot not reach this line - because it is EXECUTED (otherwise the Expert Advisor has not done what I expect from it).

2 - using the Print ("profit=", OrderProfit()); (which also behaves strangely - then writes, then keeps silent...) I get the following output:

"profit=-0.24".

which apparently means in dollars. But when I write in the condition ifOrderProfit()>10 - it easily passes through...

 
Desead:

does anyone know about the rollover?

When orders are reopened with rollover, can there be slippages for stop and takeout values ? And how will the stop be set if after the rollover the difference between the open price and the stop will be less than the stop leveller ?

My task is as follows. If i have an open market order, i should check if it was opened with rollover and if it was, i should get the ticket of the previous order, that was closed. Maybe someone will suggest a search algorithm? I am doing so so far:

1. I select the first open order.
2. I look time of its opening, if it is opened from 23:40 to 00:20, then I continue to check this order further (40 minute window is taken just in case, though in idea it is possible to take from 23:50 to 23:59)
3. I memorize the ticket, stop and take
4 I check all the closed orders based on the history, where the comments contain the word "swap" and the currency pairs match

5. I should compare data on stops and Takeovers. If they are similar, here is the required pair of orders, if not - I return to step 1

1. I have no slippage at rollover, it is a technical point.

2.(3-4-5) It is enough to check if there is a swap in the comment at the specified rollover time.

 
Zhunko:
I am a telepath! What happened? :-))


Is it somehow possible to write comments to the lines like the ones that are written when an order is placed (ticket number and order type)?

So tell me, not a telepath, what lines are we talking about?

 
rigonich:


Is it somehow possible to write comments to the lines like the ones that are written when an order is placed (ticket number and order type)?

So explain to me, not a telepath, what lines are we talking about?


it's the green dotted line marking the opening level of the trade :))
 
lottamer:


1 - the program cannot fail to reach this line - because it is EXECUTED (otherwise the EA would not do what I expect it to do).

2 - using the Print ("profit=", OrderProfit()); (which also behaves strangely - now writing, now silent...) I get the following output:

"profit=-0.24".

which apparently means in dollars. But when I write in the condition ifOrderProfit()>10, it easily passes through it...


This can mean, for example, that the wrong order has been selected for modification, which parameters you are asking for, or something else.

If the Expert Advisor does what it's supposed to do, why else would you do something with it?

Almost any program does not get to some places during its execution. For example, if there is an if() operator in a program and the condition is false, the part of the operator following the condition is not executed, i.e. the program does not get to it.

 
rigonich:

If you don't answer, it may mean that you have chosen the wrong order for the modification or something else.


I have it simple here - the orders are always one at a time. there cannot be 2 of them. therefore it is difficult to miss the parameters....

print is silent, and the command following it, which is in a BOX with it, passes (close the deal)

it must be something in the size of the profit...maybe it's the points? and i need to put 0.001 ?

even though it says "-0.24" clearly - dollars...

don't get it...

 

Good evening! Can you tell me, will this condition work - not an exact response plus or minus three points?

 if(tsena+3*Point>Ask&&tsena-3*Point<Ask&&wtoraya__stupen){//Если, пройдя сто пунктов вверх,или вниз, цена вернулась обратно, удаляем все позиции.  
    

I've been drawing two coordinate axes on separate paper for 25 minutes, guessing.

 
lottamer:

is a green dotted line marking the opening level of the deal :))

In the terminal there are different lines, horizontal, vertical, trend lines, lines of order levels, lines of the current price Ask and Bid, indicator lines and other lines.
Reason: