Forum

Cutomze indicator, how to get indicator level value?

For example, in a RSI indicator, we can use IndicatorSetDouble to set the levels to, e.g, 70 and 30, but how to retrieve the values from the code? There is no IndicatorGetDouble... Thanks

Type casting reference to object to derived class?

class Base { }; class Derived : public Base { public : void MyFunc( const Base & obj) { // how to type cast obj to Derived? } }; As the code above, the obj passed to MyFunc is indeed Derived. So how can I type cast it to Derived? Also, seems reference '&' can only be used as

OrderType() returns wrong in a complicated EA while it's correct in another simple EA

Hi all, I have two pending orders for test purpose. One is buy limit ( OP_BUYLIMIT is 2), another is sell stop which is OP_SELLSTOP 5. There are only those two pending orders, no any other orders or trades. I put the following code in an almost empty EA, in the OnInit function, for ( int i =

Global scoped variables don't reset after changing time frame?

Hi all, I'm coding an EA. I have a global scoped variable. The pseudo code looks like: bool hasDoneSomething = false ; int OnInit () { blah blah } void OnTick () { if (! hasDoneSomething) { hasDoneSomething = true ; callAnotherFunction(); } } I loaded the EA on the chart, it works fine

Can't MT4 run in VirtualBox XP/Win7?

Hi, I tried to run latest version MT4 on XP and Win7 in VirtualBox, it crashes on startup. Can MT4 run in VirtualBox? Or it "detects" the virtual machine and kill itself for anti-debug purpose? I need to run MT4 in virtual machine to do some test. Thanks

How to cause OnTick called from a DLL?

I download FX Blue QuickChannel library, seems it can make OnTick called whenever a new message is sent, from a DLL (indeed from another process). in QuickChannel pdf document, it says, ============= Once an EA/script has called QC_StartReceiver(), it receives a tick whenever a new message is

Can I post indicators for sale in "Commercial Trading Systems and indicators"?

Hi, all, I've read a lot of high quality content on TSD and recently I decided to register and join the forum. My question is, what's the forum "Commercial Trading Systems and indicators" for? Can I post my commercial indicators there? I don't see many commercial indicators in that forum. By

How to know if an indicator is first run

Hi all, Before all, let me define "first run". From MQL documentation, https://docs.mql4.com/runtime/running Loading and Unloading of Indicators Indicators are loaded in the following cases: an indicator is attached to a chart; (This is first run) terminal start (if the indicator was attached to the

Questions on selling MT4 indicators with DLL

Hi, I developed a bunch of indicators in C++ to use in my private trading/backtesting system. Now I'm thinking to wrap them in MT4 indicator so I can sell or publish them. But I have a few questions, 1, Seems MetaQuote market doesn't allow DLL, thus I can't use the market. Then any elsewhere can I