[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 226

 
01123456789:
By saying: "I meant a pending order (for example, Buy Stop) with two columns for Stop Loss and Take Profit. That is, if I want to get a profit of 50 pips, I should specify 53 points of take profit in the pending order, instead of 50 because 3 points will affect the spread. Right?
Every brokerage company has this in its contract. Buy orders are closed along the Ask line and Sell orders along the Bid line. All you understand correctly. Depending on the spread, you will add it to your profit. If you want to get 50 pips, you will get +3 (depending on the spread of the currency pair). Do not forget that all the charts are drawn by Bid.
 
deyron:
Every brokerage house has this in the contract. Buy orders are closed on the Ask line and Sell orders on the Bid line.
Is it so? It seems to me that you are mistaken. The Buy orders open on Ask prices and close on Bid prices. Sell orders are opened by Bid lines and are closed by Ask lines. In other words, if we buy (Ask price), we close the transaction by selling (Bid price).
 
deyron:

Hello! Help me to understand the user-defined function.

I understand: if condition is true, it returns for isitpik-(true). The condition is calculated by 0-th buffer, in which the calculation from AO lies. Or only last i-bar lies in the buffer and at occurrence of conditions for these criteria then (true) is passed to isitpik()? And why assign int type to variable (i) if it is done by condition above.


Read it carefully:

double iAO( string symbol, int timeframe, int shift)
Calculation of Awesome oscillator.
Parameters:
symbol - Symbol name of symbol, on data of which the indicator will be calculated. NULL means current symbol.
timeframe - Period. Can be one of the periods of the chart. 0 means the period of the current chart.
shift - Index of the value obtained from the indicator buffer (shift relative to the current bar by the specified number of periods back).
Example:
 double val=iAO(NULL, 0, 2);

More:

Global variables, the scope of global variables is the entire program, global variables are accessible from all functions defined in the program.

A variable declared within a function is a local variable. The scope of a local variable is limited to the limits of the function, within which it is declared.

 
deyron:
Just double-checked, they open at the current Bid price. (Both Sell and Buy)


Do not mislead a human.

BUY open at Ask, close at Bid.

SELL - on the contrary.

 

r772ra


Thanks for the reply.

 
PapaYozh:


Don't mislead the man.


I'm sorry(((, I was wrong. You said it right.
 

Gentlemen. How to make the difference in iMA show not 0.00002 but 0.000192 (somehow rounded off roughly)

what did I miss?

   double MA_razn_1=iMA(NULL,0,5,0,MODE_SMA,PRICE_MEDIAN,1)-iMA(NULL,0,34,0,MODE_SMA,PRICE_MEDIAN,1);
   
   Print("MA_ razn_1 = ",MA_razn_1);
 

I have a question:

I know that EAs and scripts can only create and modify files in the experts/files folder. Can I work with files in subfolders of this folder?

If so, can you show me an example of how this is done in the code?

Or maybe someone had a dll-case to work with files not in this directory?

Or maybe someone knows some external software for continuous synchronization of files folder from another folder on the computer?

 
deyron:

Gentlemen. How to make the iMA difference show 0.000192 instead of 0.00002 (it's kind of roughly rounded up)

what am I missing this time?

Try me:

double MA_razn_1=NormalizeDouble(iMA(NULL,0,5,0,MODE_SMA,PRICE_MEDIAN,1)-iMA(NULL,0,34,0,MODE_SMA,PRICE_MEDIAN,1),10);   
   Print("MA_razn_1 = ",DoubleToStr(MA_razn_1,10)); 
 
Roman.:

Try it:

Thanks, great! I'm already hooked))))

Tell me if it's not difficult, what's the catch? I poked around the site and did not find the explanation (( or if you can throw a link.