[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 941

 
q1shock:


in this code, look for errors, OrderSend function by pressing F1 will bring up help in the standard editor, look at the order of incoming parameters there is an error.

+ use Print / Alert to go through the variable values, insert it in the code section after ( assignments / execute )

and remember to normalize the output, DoubletoSt..NormalizeDouble..TimeToStr

Attached here are 2 free libraries with code by kimIV.

The code is simple, ready-made functions, great for beginners.


Yes, I got it, I messed up the OrderSend line. Of course, I should work with the tested functions. Thank you very much!

P.S. It's not really laziness, but just a feeling that the speed of testing and optimization drops with every extra line. Your opinion?

 
001:

Yes, I got it, I messed up with the OrderSend line. Of course, I should work with tested functions. Thank you very much!

P.S. It's not really laziness, but just a feeling that the speed of testing and optimization drops from every extra line. Your opinion?


Just make a test script and check the speed.

 

Such a question:

How do I set a check on what the total profit for the current day is?

Suppose I have an open order (which is currently in deficit), but the day ends, and I don't want to leave it running for the next day. I need the Expert Advisor to check the total profit for that day (including the negative profit of the open order) and, if the total profit for the day is more than a certain amount (the number of points), it will close the remaining order.

 
001:

Yes, I got it, I messed up with the OrderSend line. Of course, I should work with tested functions. Thank you very much!

P.S. It's not really laziness, but just a feeling that the speed of testing and optimization drops from every extra line. Your opinion?


It all depends on the code, in general yes

 
advise how to call an advisor or script that triggers a pending order(or when the order opens itself) and the approach of price to take profit, takes a take profit and simultaneously moves the stop to Breakeven (to remove the maximum possible profit and stay in Breakeven in case of price reversal) ... just call it a system, like trawler or what?
 
ilmur:
advise how to call an advisor or script that triggers a pending order (or when the order opens itself) and the approach of price to take profit, takes a take profit and simultaneously moves the stop to Breakeven (to remove the maximum possible profit and stay in Breakeven in case of price reversal) ... just call it a system, like trawler or what?

Very interesting logic, don't you think? Take is constantly moving away and the price will never reach it. In this case, the stop loss does not follow the price, it remains at breakeven - and this is a minimum profit, if not zero (including spread, swaps, commissions, etc.) ...

Maybe we should use StopLeverell+spread and not torture our ass... ...animal?

 
artmedia70:

Very interesting logic, don't you think? The Take is constantly moving away and the price will never reach it. In this case, the stop-loss is not pulled behind the price, but remains at breakeven, which is a minimum profit, if not zero (including spread, swaps, commissions, etc.)...

Maybe we should use StopLeverell+spread and not torture our ass... ...animal?

I'm not saying breakeven as a minimum but as much as possible in profit... I must have misunderstood... If a reversal takes place everything will stand on its own and the order may be closed by a stop loss but in profit...
 

Hi all, I have this question:

I need to change values of some variables in my EA under certain conditions .

The variable names and their new values are exported through a csv file, I put them in an array, but there is a problem...

how do I rename these variables? Because if I write it like this:

arr[1]=arr[2] (with the first argument being the variable name and the second its new value)

it will simply try to assign the value of arr[1] to arr[2].....

For global variables there is function GlobalVariableSet() here the same would help, but not to translate all variables to global I have no desire...

Maybe there is something similar for common variables?

 
ilmur:
advise how to call an advisor or script that when a pending order triggers (or when the order opens itself) and the price approaches a take profit, it moves the take profit and simultaneously moves the stop to breakeven (to take the maximum possible profit and stay in breakeven if the price reverses)... just how is this system called, like a trawler or what?...please advise and if you're not hard to send a link to a sample of this advisor

It's easier to put a trailing parabolic, it's hard to get more out of an EA than it will.
 
Such a question:

How do I set a check on what the total profit for the current day is?

Suppose I have an open order (which is currently in deficit), but the day ends, and I don't want to leave it running for the next day. I need the Expert Advisor to check the total profit for that day (including the negative profit of the open order) and, if the total profit for the day is more than a certain amount (the number of points), it will close the remaining order.
Reason: