algorithmic-trading

How to use CopyRates() to search and filter through several timeframes for Bullish Engulfing pattern

北慕城南 提交于 2020-07-01 10:43:24
问题 The bounty expires tomorrow . Answers to this question are eligible for a +100 reputation bounty. SuperHueman wants to draw more attention to this question: To receive this bounty, a user should provide tested code on finding all bullish engulfing patterns on timeframes H2 to M10 within a bullish H4 candle using CopyRates(). From the found bullish engulfing patterns the one with the highest bearish to bullish candle body ratio should by filtered out searching through with CopyRates(). Note

What is the equivalent of console.log in pine-script?

情到浓时终转凉″ 提交于 2020-06-24 11:15:27
问题 How does one console.log variables , or the results of functions in pine-script ? I'd like to convert a pine-script script into javascript , and I'd like to verify that the script I'm converting is the same as the original. Any work arounds are welcome if this functionality does not exist. Thanks! 回答1: There is no way to print text or variables in pine-script to any form of "console". But you can use plot to print, very short text above or below each tick. The text, however, is static and you

How to search for a candlestick pattern on multiple timeframes

懵懂的女人 提交于 2020-06-21 05:26:06
问题 I have an expert advisor that draws rectangle on a specifically defined bearish pinbar followed by a bullish candle. Please see the code below. It basically shows the rectangle on the timeframe displayed on the chart. How can I search for this candlestick pattern on timeframes within an H1 candlestick down to M2 in such a way that I can filter the pattern that has the longest bearish pinbar from all timeframes? string prefix="PBar"; int magicnumber = 12345; bool drawBearPinbarRectangle(int

How can I recognise programmatically when an up/down arrow is drawn on a chart when arrow objects are hidden?

浪子不回头ぞ 提交于 2020-05-28 04:25:51
问题 I know how to draw an object arrow on the chart, which I usually do like this: ObjectCreate(0,"prevHigh",OBJ_ARROW_DOWN,0,Time[0],High[highestCandle]); ObjectSetInteger(0, "prevHigh", OBJPROP_COLOR, clrRed); Now I have an indicator which (I didn't code myself and is a .ex4 file which) draws up/down arrows on the chart as seen in the image (https://imgur.com/a/8yG0suw). How can I when for example a Magenta down arrow has been drawn and the candle (index) at which it is drawn? Please note that

Converting mql4 EA to mql5

泄露秘密 提交于 2020-04-07 03:20:31
问题 I have been trying to figure out how to change my MQL4 code to MQL5. So far I've been able to change the RSI and MACD conditions and SendOrder() but there's a lot, like the ModifyOrder() and CloseOrder() amongst other stuff that I've not been able to do to complete it. I know this is a mouthful but I would really appreciate some help in completing this. This is the original MQL4 code: extern int MagicNumber=112223; extern double Lots =0.005; extern double StopLoss=0; extern double TakeProfit

Converting mql4 EA to mql5

对着背影说爱祢 提交于 2020-04-07 03:20:28
问题 I have been trying to figure out how to change my MQL4 code to MQL5. So far I've been able to change the RSI and MACD conditions and SendOrder() but there's a lot, like the ModifyOrder() and CloseOrder() amongst other stuff that I've not been able to do to complete it. I know this is a mouthful but I would really appreciate some help in completing this. This is the original MQL4 code: extern int MagicNumber=112223; extern double Lots =0.005; extern double StopLoss=0; extern double TakeProfit

Converting XGBoost tree structure dump file to MQL4 (C like language) code

主宰稳场 提交于 2020-02-20 10:32:50
问题 I have a dump file of XGBoost tree structure trained in Python. The structure has 377 trees, and file has approximately 50,000 lines. I would like to convert this structure to MQL4 code, or C code so to say. The text file looks something like this: booster[0]: 0:[inp0<6.85417] yes=1,no=2,missing=1 1:[inp10<1.00054] yes=3,no=4,missing=3 3:[inp21<0.974632] yes=7,no=8,missing=7 7:[inp22<1.01021] yes=15,no=16,missing=15 15:[inp15<0.994931] yes=31,no=32,missing=31 31:[inp12<0.999151] yes=63,no=64

How can I convert Metatrader 4 alert or email indicator signal to Expert Advisor to open trades?

筅森魡賤 提交于 2020-01-22 19:53:43
问题 I have been using an indicator to take trades. I didn't develop the indicator, so I only have access to the .ex4 file. How can I extract the take profit, open trade and stop loss values in the alerts or email signals to open trades? Please see a sample of the email and alert signals below. 回答1: Here is a working example script of a native MQL solution which uses kernel32.dll to copy the log file from ./MQL4/Logs to ./MQL4/Files . The LogSignalParser abstract base class needs to be subclassed

How to apply the Hurst Exponent in Python in a rolling window

坚强是说给别人听的谎言 提交于 2020-01-13 18:55:09
问题 I am trying to apply the Hurst Exponent on SPY closing prices on a rolling window. The below code (which I got from here: https://www.quantstart.com/articles/Basics-of-Statistical-Mean-Reversion-Testing) works well if I apply it on the closing prices column. However this gives me a static value. I would like to apply the Hurst Exponent on a rolling window considering the last 200 closing prices. My objective is to get a column in which the Hurst Exponent is updated in each row considering the