Questions tagged [metatrader5]

Trading platform to provide brokerage services in Forex, CFD, Futures and equity markets.

211 questions
2
votes
3 answers

How can I use either < or > (or other comparative operator) in an expression depending on a function input?

I have two longish blocks of code that are identical except in various comparative statements > is switched with <, >= with <= etc. I wanted to put these in a function and use one operator or another depending on a function input. I am coding in…
whitebloodcell
  • 258
  • 1
  • 4
  • 10
1
vote
0 answers

Converting a Heikin Ashi related PineScript to MQL5

The pinescript code is like the following ha = heikinashi(tickerid) ha_close = security(ha, res, close[1]) ma = ema(ha_close[1], 30) I'm trying to use the above code in MetaTrader5. So I tried the following, [ Using https://www.mql5.com/en/code/33…
Bucky
  • 640
  • 2
  • 10
  • 27
1
vote
1 answer

Close position from MT5 Python API not working

I'm trying to close an existing position in MT5 from Python but MT5 always claims an 'Unsupported Filling Mode'. I tried all possible filling modes but always get the same result. Same, if I omit the filling mode in the request. I also tried to…
hoga
  • 11
  • 2
1
vote
1 answer

iCustom function problem MQL5 not returning values

I'm not able to get the values ​​of the vwap indicator, does anyone know why? h_vwap = iCustom(Symbol(), Period(), "VWAP_Simple 2.00","Close price", "Daily", "Tick volume");
1
vote
1 answer

Changing stoploss in metatrader5 with python using Metatrader5 library and nothing happens

I have this code for changing stoploss on opened order/orders in metatrader 5. When I run this code nothing happens even when my compiler print that, nothing is wrong. I have algotrading on so I'm not sure where is the problem. Here is source…
Kurina11
  • 25
  • 7
1
vote
2 answers

How to install Windows Python package/library on linux and use it

I want to install package MetaTrader5 on my Linux [Fedora], but this package is supported only for Windows. And my question is: Is it possible to install Windows Python packages on Linux? and after installation import in my python file? My Solution…
renta
  • 11
  • 2
1
vote
0 answers

MetaTrader 5 Web API

I was trying to implement the command to get the Chart data using PHP, below is the code:
Ray A
  • 1,155
  • 2
  • 8
  • 18
1
vote
0 answers

How to remove weekend values from stock chart

You can see straight lines on the chart, they connect prices between Friday and Monday, how to remove the weekend from the chart? There are no values in the data for the weekend, there are just gaps P.S. I noticed this problem both in the plotly…
RoyalGoose
  • 285
  • 2
  • 13
1
vote
1 answer

console output using shellexecuteW

I'm using ShellExecuteW from shell32.dll: int value= ShellExecuteW(0, "open", "C:\test.bat", strParameters, "", 1); The batch file runs a java app which seems to open but returns an error and quickly the console window closes. I want to capture the…
1
vote
0 answers

MQL5 error [4805] - Error applying an indicator to chart

I'm facing a strange error if I try to run my code: The creation of iRSI has failed: RSI_handle_38 = -1 Runtime error = 4805 tester stopped because OnInit returns non-zero code 1 The error [4805] is described in MQL5 docs like…
1
vote
1 answer

Latest Pricing of Asset is not the same value as tradingview

from datetime import datetime import MetaTrader5 as mt5 import requests import datetime as dt import numpy as np import json from statistics import mean import pandas as pd import pytz import os import time import math #Im living in…
Andy Quek
  • 31
  • 3
1
vote
0 answers

How to determine if price returned to a certain region of values or not on a specific timeframe

My code below draws a rectangle based on certain conditions. I want to add another condition for drawing the rectangle. The rectangle is drawn from the open to the high of a bullish candle with index (i+1) as shown in the code. How can I tell if…
NSSwift
  • 385
  • 1
  • 12
1
vote
1 answer

MetaTrader Terminal 4: debugging an expert advisor on historical data

I have a MetaTrader Terminal 4 logged into a demo account. I have written and compiled my first Expert Advisor. I am able to debug it on a live chart, so working fine. I would like to debug it though on historical data. In the MetaEditor the…
mHelpMe
  • 5,782
  • 15
  • 59
  • 109
1
vote
2 answers

sending order to open a position via MetaTrader5 python module and nothing happens

I followed Metatrader5 python documentation and this answer in stack overflow I try to open a sell position: import MetaTrader5 as mt5 ea_magic_number = 9986989 # if you want to give every bot a unique identifier def get_info(symbol): …
kave Mohammadi
  • 55
  • 1
  • 10
1
vote
1 answer

Metatrader5 - Python Integration - symbol_total() returns None

I'm trying to get the number of symbols of metatrader5 and I'm getting an error TypeError: '>' not supported between instances of 'NoneType' and 'int' Link to the documentation:…
1 2
3
14 15