On the first part (order counting) I recommend it:
//+----------------------------------------------------------------------------+//| Подсчет ордеров |//+----------------------------------------------------------------------------+//| -1 - Все типы ордеров |//| 0 - ордера типа BUY |//| 1 - ордера типа SELL |//| 2 - ордера типа BUYLIMIT |//| 3 - ордера типа SELLLIMIT |//| 4 - ордера типа BUYSTOP |//| 5 - ордера типа SELLSTOP |//+----------------------------------------------------------------------------+int CountOrders(string symb="", int or_ty=-1, int magiс=-1)
{
int cnt=0;
if(symb=="0") symb=_Symbol;
for(int pos=OrdersTotal()-1;pos>=0;pos--)
{
if(OrderSelect(pos,SELECT_BY_POS)==true)
{
if((OrderSymbol()==symb || symb=="")&&(or_ty<0 || or_ty==OrderType()))
{
if(magiс<0 || OrderMagicNumber()==magiс) cnt++;
}
}
}
return(cnt);
}
Next
voidOnTick()
{ // НАЧАЛО ОН ТИКint count_orders_market_buy = CountOrders(_Symbol,0,magik_number); // КОЛИЧЕСТВО БАЙ ОРДЕРОВint count_orders_market_sell = CountOrders(_Symbol,1,magik_number); // КОЛИЧЕСТВО СЕЛ ОРДЕРОВint count_orders_buy_limit = CountOrders(_Symbol,2,magik_number); // КОЛИЧЕСТВО БАЙ ЛИМИТint count_orders_sell_limit = CountOrders(_Symbol,3,magik_number); // КОЛИЧЕСТВО СЕЛ ЛИМИТint count_orders_stop_buy = CountOrders(_Symbol,4,magik_number); // КОЛИЧЕСТВО БАЙ СТОПint count_orders_stop_sell = CountOrders(_Symbol,5,magik_number); // КОЛИЧЕСТВО СЕЛ СТОП
And the error is probably here (highlighted in yellow)
if(OrderSend(Symbol(),OP_BUY,lot,Ask,slippages,Ask-sl,Ask+tp,Coment ГДЕ МАГИК? )) Print("Buy Open");
In the description of the Fibonacci levels in the properties window, you can change their values to price levels via %$. How to get the price of the levels programmatically, I can't find.
Galim_V: In the description of the Fibonacci levels in the properties window, you can change their values to price levels via %$. How to get the price of the levels programmatically, I can't find.
Thank you, Makar! But I don't know how to use it. I need to get price values of standard fibo levels.
Banned function allows me to replace the standard ones with price ones. But where do I get them? Somewhere they are.
Between the prices of fibo, it's 100% and all other levels are calculated from these values. You can calculate not only standard values, but any values approximately according to this formula:
Price_0 + (Price_1 - Price_0) * 0.27;
And the banned function allows you to enter the same "%S" in the level description in order for the levels to show the price.
Thank you, Makar! But I don't know how to use it. I need to get price values of standard fibo levels.
Banned function allows me to replace the standard ones with price ones. But where do I get them? Somewhere they exist.
voidOnStart()
{
//--- а сколько у нас Фибо-уровней ?int levels=ObjectGetInteger(0,"Fibo",OBJPROP_LEVELS);
Alert("Fibo levels before = ",levels);
//---выведем в Журнал=> номер уровня:значения описание_уровняfor(int i=0; i<levels; i++) {
Alert(i,":",ObjectGetDouble(0,"Fibo",OBJPROP_LEVELVALUE,i),
" ",ObjectGetString(0,"Fibo",OBJPROP_LEVELTEXT,i));
}
}
2021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 0:-0.252021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 1:0.02021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 2:0.52021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 3:1.02021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 4:1.52021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 5:2.02021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 6:2.52021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 7:3.02021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 8:3.52021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 9:4.02021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 10:5.02021.01.2916:16:32.116 Instant direction GBPJPYb,M5: 11:6.02021.01.2916:16:37.952 Instant direction GBPJPYb,M5: Fibo levels before = 12
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Cool... didn't expect.... something like this from the past... , thank you.
On the first part (order counting) I recommend it:
Next
And the error is probably here (highlighted in yellow)
It's tinny. All the colours are offset. But the colours have emerged. And on the preview, it's all good too....
Not critical... but it's not a shame...
In the description of the Fibonacci levels in the properties window, you can change their values to price levels via %$. How to get the price of the levels programmatically, I can't find.
OBJPROP_LEVELVALUE
OBJPROP_LEVELVALUE
Thanks, Makar! But I don't know how to use it. I need to get price values of standard fibo levels.
Banned function allows me to replace standard with price levels. But where do I get them? There must be one somewhere.
Thank you, Makar! But I don't know how to use it. I need to get price values of standard fibo levels.
Banned function allows me to replace the standard ones with price ones. But where do I get them? Somewhere they are.
Between the prices of fibo, it's 100% and all other levels are calculated from these values. You can calculate not only standard values, but any values approximately according to this formula:
Price_0 + (Price_1 - Price_0) * 0.27;
And the banned function allows you to enter the same "%S" in the level description in order for the levels to show the price.Thank you, Makar! But I don't know how to use it. I need to get price values of standard fibo levels.
Banned function allows me to replace the standard ones with price ones. But where do I get them? Somewhere they exist.
It's like this
Like this.
Is this checked? )))))
Is this verified? )))))
The price doesn't show(