trading

Why is my EA not moving my position to breakeven?

限于喜欢 提交于 2019-12-08 23:32:33
I'm attempting to modify my market orders to breakeven the position when the position get 100 pips to the good. This also accounts for the StopLevels which are around 20-30 pips for my broker. It checks the param's via a " for(){...} loop" function The MagicNumber is the timeframe number for the chart it is on (i.e. 240 =4H, 60 =1H) I don't set a TakeProfit price & initially no StopLoss price. The EA is not adding a SL to be equal to the opening price when the trade reaches 100 pip in profit (plus stoplevels). Profit points reaches well over 130 points. My code is below for a OP_SELL order -

Fundamental data based trading algorithms

北城以北 提交于 2019-12-08 08:24:32
问题 Q1: Is it possible to create a script/algorithm that will purely place a BUY or SELL order of a selected currency pair, depending on whether e.g. an interest rate announcement is higher ( or lower ) than the forecast figure? I know many other technical and fundamental factors must be taken in to account before buying and selling financial instruments, but purely as an experiment I'd like to determine if this method is possible. If this can be achieved, Q2: how can an interest rate

Configure event profile in pyalgotrade to look back further than one bar ( eg bards[-2] )

别等时光非礼了梦想. 提交于 2019-12-08 08:10:56
问题 I'm trying to write various predicates on simple candle stick structures. For example one component of a '3 green candles in a row' predicate would require a look back of -4 To start off simple I try an test it with a 'higher_highs' predicate. If the close of the previous candle is below the current candles close the function returns true. Below is my code: from pyalgotrade import eventprofiler from pyalgotrade.barfeed import csvfeed class single_event_strat( eventprofiler.Predicate ): def _

Interactions between Expert Advisor and Indicators on MQL4

十年热恋 提交于 2019-12-08 03:40:16
问题 Is it possible to read changes in pre-built indicator (for example: its value changes) through an expert-advisor, and of course - automate the trades based on those reads? What is the function that is responsible for doing this? I have tried to look this up on Google, but it appears I can only do things like track object creation or deletion ... called Chart Events.... maybe I'm missing something? 回答1: Yes, it is possible. MetaTrader4 Terminal is a software platform, that allows you to launch

What is the meaning of the values returned from trader_bbands()?

◇◆丶佛笑我妖孽 提交于 2019-12-07 07:58:59
问题 I am using the trader library of PHP. I use the trader_bbands() function $bBand = trader_bbands( $NumberArray, 25, TRADER_REAL_MIN, TRADER_REAL_MIN, TRADER_MA_TYPE_EMA ); It returns three arrays. $bBand[0]; // upper-edge of the Bollinger Band ( an upline ) $bBand[1]; // central line the Bollinger Bands surround ( a moving average ) $bBand[2]; // lower-edge of the Bollinger Band ( a downline ) My original $NumberArray values are all around 2000.0 $bBand[1] is simple moving average so, it

Configure event profile in pyalgotrade to look back further than one bar ( eg bards[-2] )

夙愿已清 提交于 2019-12-06 15:44:54
I'm trying to write various predicates on simple candle stick structures. For example one component of a '3 green candles in a row' predicate would require a look back of -4 To start off simple I try an test it with a 'higher_highs' predicate. If the close of the previous candle is below the current candles close the function returns true. Below is my code: from pyalgotrade import eventprofiler from pyalgotrade.barfeed import csvfeed class single_event_strat( eventprofiler.Predicate ): def __init__(self,feed): pass def higher_highs(self, instrument, bards): #prev_three = bards[-4] #prev_two =

Building a trading platform with charts - suggestions for a Python GUI Library

∥☆過路亽.° 提交于 2019-12-06 01:39:49
问题 I am building a small program to retrieve data from the market and chart it in real time. While the trading decisions will be largely automated, the charts are updated continuously so that someone can keep track of how the decisions are being taken and manually intervene when necessary. What would be a good GUI Library for the task (for Python). Here are the considerations - Programming Language : Python (Do you think I should use something else? May be even do the GUI and backend in

What is the meaning of the values returned from trader_bbands()?

丶灬走出姿态 提交于 2019-12-05 13:25:44
I am using the trader library of PHP. I use the trader_bbands() function $bBand = trader_bbands( $NumberArray, 25, TRADER_REAL_MIN, TRADER_REAL_MIN, TRADER_MA_TYPE_EMA ); It returns three arrays. $bBand[0]; // upper-edge of the Bollinger Band ( an upline ) $bBand[1]; // central line the Bollinger Bands surround ( a moving average ) $bBand[2]; // lower-edge of the Bollinger Band ( a downline ) My original $NumberArray values are all around 2000.0 $bBand[1] is simple moving average so, it returns the numbers around 2000. However $bBand[0] and $bBand[2] return values like this below (example

How to continuously export data from Amibroker

[亡魂溺海] 提交于 2019-12-05 07:52:59
问题 Need to test an algotrading tool to be used for day trading. To get the intra-day live data from NSE, some vendors are selling data plugins for Amibroker. To get the data out of Amibroker I intend to use AFL ( Amibroker Formula Language ). The following code in AFL creates the .csv files for each symbol once. But to use the live data I need to append incoming data to the .csv file continuously throughout the day. How can this be done without crashing / overloading Amibroker ? // created a

Grouping and auto incrementing group id in pandas

Deadly 提交于 2019-12-05 07:28:27
问题 I have python pandas data frame trades = pd.DataFrame({"Qty":[-25,0,25,50,75,0,25,0,-25,0,-25,-50,0,-25,50,0]}) print trades Qty 0 -25 1 0 2 25 3 50 4 75 5 0 6 25 7 0 8 -25 9 0 10 -25 11 -50 12 0 13 -25 14 50 15 0 Qty is cummulative qty sold/bought, when it goes to 0, the position is flat. I want to assign group ids, so that I can extract executed trades from the orders placed. Qty Trade_Group 0 -25 1 1 0 1 2 25 2 3 50 2 4 75 2 5 0 2 6 25 3 7 0 3 8 -25 4 9 0 4 10 -25 5 11 -50 5 12 0 5 13 -25