Errors, bugs, questions - page 2145

 
fxsaber:

Even with the GUI it is impossible to set such values


How to set contract size, minimum lot, pip size, price step for custom BTCUSD so that you can buy at least 0.00035 BTC (some exchanges allow this)

 
Ivan Titov:

How then to set contract size, minimum lot, pip size, price step for custom BTCUSD so that you can buy at least 0.00035 BTC (some exchanges allow it)

Custom symbols may contain such restrictions. Thanks to your posts, developers can remove these random (can not account for everything) limitations. Write to SD for that.

 

In the indicator.

::ChartWindowFind() returns -1 (in other words does not work)

void OnTimer() does not work although ::EventSetTimer returns true

//Test.mq5//Скрипт
void OnStart()
{
        string name = "Test_i";
        ObjectCreate( 0, name, OBJ_CHART, 0, 0, 0 );
        long chart_id = ObjectGetInteger( 0, name, OBJPROP_CHART_ID );
        ChartIndicatorAdd( chart_id, 1, iCustom( NULL, PERIOD_CURRENT, name ));
}

//Test_i.mq5//Индикатор
#property indicator_separate_window
void OnInit()
{
        ResetLastError();
        bool b = EventSetTimer( 5 );
        Print( "1:", b,          ":", GetLastError());
        ResetLastError();
        int sub_window = ChartWindowFind();
        Print( "2:", sub_window, ":", GetLastError());  
}
void OnTimer() { Print( __FUNCTION__ ); }
int OnCalculate( const int, const int, const int, const double& [] ) { return 0; }

Let's launch the Test.mq5 script

Result: 1:true:0
2:-1:4113

No message from timer

 
A100:

In the indicator.

::ChartWindowFind () returns -1 (in other words does not work)

Does the subwindow in OBJ_CHART appear?

 
fxsaber:

Does the subwindow in OBJ_CHART appear?

OBJ_CHART with subwindow appears
 
A100:
OBJ_CHART with subwindow appears

EAs on OBJ_CHART certainly don't run (or rather, don't work). So by timer, it seems to be OK. It is possible that all events are not working there.

 
A100:

In this form C++ also generates error E2015

If you put it this way:

MQL compiles without errors, but C++ reports error E2015

Good afternoon!

Thank you for your reference, we will check

 
Evgeny Chernyshev:

Thanks for your reference, we'll check it out.

It would be really bad if the current working state is changed to a non-working C++ variant. The already written MQL code will go down.

 
fxsaber:

EAs on OBJ_CHART certainly don't run (or rather, don't work). So by timer, it seems to be OK. It's possible that all the events don't work there.

OnCalculate works, but OnTimer does not

Advisors should not work, because there is no direct mechanism to start them likeChartIndicatorAdd

 
A100:

OnCalculate works but OnTimer does not

OnCalculate is not running on this chart. You have created a handle, that's where it lives.

The Expert Advisors are not supposed to be launched/work, because there is no direct mechanism to launch them likeChartIndicatorAdd

Through a template the launch mechanism. As with the script.


SZY myself see OBJ_CHART most often as a wonderful canvas for drawing. You can do a lot of things with it, like BMP->GIF/PNG converter. And the strongest one - canvas + scales + objects. But that's a completely separate niche, as it's complicated.