Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 1103

 
Money_Maker:
Good afternoon) Please advise: how do I get the price of the expansion fibo level?
What's wrong with this line? I think the modifier points to the first line but the price of the first anchor point comes out...
I tried all the other modifiers and options
ObjectGet("Fibo",OBJPROP_FIRSTLEVEL+n);
 
evillive:
thanks for the answer,
this is what the level description gives me in this case it's 261.8 but I wish I could get the price of this level...
 
Money_Maker:
Thanks for the reply,
I get the level description, in this case it's 261.8, but I'd like to get the price of the level...
Isn't it easier to calculate the right level yourself?
 
evillive:
Isn't it easier to calculate the required level yourself?
It might have to be done that way, as it cannot be obtained from a line (although the modifier in ObjectGetDoubl states that it takes the values of a certain line (if it is a Fibo or Pitchfork))
 
Money_Maker how to get the price of the Fibo level? I think the modifier points to the first line and returns the price of the first anchor point.
ObjectGet("Fibo",OBJPROP_FIRSTLEVEL+n);

Depending on the value of n, your function returns 0.0 0.236 0.382 0.5 and so on. To get the initial and final price we use

  Время1=ObjectGet("Fibo 25894", 0);
  Цена1= ObjectGet("Fibo 25894", 1);
  Время2=ObjectGet("Fibo 25894", 2);
  Цена2= ObjectGet("Fibo 25894", 3);

Prices of other levels can be calculated using the proportion

 
LRA:

Depending on the value of n, your function returns 0.0 0.236 0.382 0.5 and so on. To get the starting and ending prices we use

The prices of the other levels can be calculated using the proportion

Thank you) I will try it this way
 

Hi all!

Can you tell me why orders are not opening?

extern int MA_1=5;

extern int MA_2=20;

extern MA_3=80;

extern inttern TP=100;

extern int SL=50;

extern double Lot=0.1;

string Symb;

//+------------------------------------------------------------------+

//| Expert initialization function |

//+------------------------------------------------------------------+

int OnInit()

{

double MA_1_t;

double MA_2_t;

double MA_3_t;

int Total;

int pos;

MA_1_t=iMA(NULL,0,MA_1,0,MODE_EMA,PRICE_CLOSE,0);

MA_2_t=iMA(NULL,0,MA_2,0,MODE_EMA,PRICE_CLOSE,0);

MA_3_t=iMA(NULL,0,MA_3,0,MODE_EMA,PRICE_CLOSE,0);

Symb=Symbol();

Total=0;

for(pos=1; pos<=OrdersTotal(); pos++)

pos=OrderSelect(pos-1,MODE_TRADES);

if(pos==0)

if(MA_1_t>MA_2_t&&Open[1]<MA_1_t&&Close[1]>MA_1_t)

{

pos=OrderSend(Symbol(),OP_BUY,Lot,Ask,3,Ask-SL*Point,Ask+TP*Point, "My order",16384,0,clrGreen);

return(0);

}

if(MA_1_t<MA_2_t&&Open[1]>MA_1_t&&Close[1]<MA_1_t)

{

pos=OrderSend(Symbol(),OP_SELL,Lot,Bid,3,SL-Bid*Point,Bid-TP*Point, "My order",16384,0,clrRed);

return(0);

}

return(0);

}

 
shtr: Can you please tell me why orders don't open?
pos=OrderSend(Symbol(),OP_SELL,Lot,Bid,3,SL-Bid*Point,Bid-TP*Point, "My order",16384,0,clrRed);

What does it say in the log? In ECN accounts, for example, you have to open with zero stops (SL TP) and then modify. Otherwise error 130

 
LRA:

What does it say in the log? On ECN accounts, for example, you have to open with zero stops (SL TP) and then modify. Otherwise error 130

2016.10.11 08:51:37.151 Expert 1111 GBPUSD,M15: loaded successfully
2016.10.11 08:51:39.678 TestGenerator: current spread 3 used
2016.10.11 08:51:46.724 2016.01.01 00:00 1111 inputs: MA_1=5; MA_2=20; MA_3=80; TP=100; SL=50; Lot=0.1;

2016.10.11 08:52:02.646 GBPUSD,M15: 2399186 tick events (2922 bars, 2400187 bar states) processed in 0:00:15.922 (total time 0:00:25.437)

This is from the tester.


 
shtr:

Hi all!

Can you please tell me why orders are not opening?

Init is init, trade is init. There is OnTick for EAs, there is no need to cram everything into the init...

And for inite, there are special exit codes invented by the developers, why don't you use them?