RENKO EA AUTO TRADER tfollower smart scalper stop loss multi currency kingle forex fury best free forex robot wall street skyblue R blessing auto trader renko MEDIAN RENKO AUTO TRADING ea supply oxygen ea recovery volume profile finch FUSION SPIKE FXDOS EA FXDOS EA Forex earth robot batman pivot sa ea Millions forex auto millions snowball breackout Breakout dave
The next method, add_new_position, takes the parameters necessary to add a new position to the Portfolio. Notably, it takes the add_price and the remove_price. I have not used the bid and ask prices here directly because the addition and removal prices will depend upon whether the side is "long" or "short". Hence we need to correctly specify which price is which in order to obtain a realistic backtest:
One might sensibly ask why I'm posting it if it has all these limitations? The rationale here is that I want individuals of all levels to realise that building algorithmic trading systems is hard work and requires a lot of attention to detail! There is a significant amount of scope for introducing bugs and incorrect behaviour. I want to outline how "real world" systems are built and show you how to test for these errors and correct them.
Borrowing money to purchase securities is known as "buying on margin". When an investor borrows money from his broker to buy a stock, he must open a margin account with his broker, sign a related agreement and abide by the broker's margin requirements. The loan in the account is collateralized by investor's securities and cash. If the value of the stock drops too much, the investor must deposit more cash in his account, or sell a portion of the stock.
In order for this Portfolio to function with the new means of generating signals and orders it is necessary to modify event.py. In particular I've added the SignalEvent component, which is now generated by the Strategy object, instead of an OrderEvent. It simply states whether to go long or short a particular "instrument", i.e. currency pair. order_type refers to whether the order is a market order or limit order. I've not yet implemented the latter, so this will remain as "market" for now:
Margins are a hotly debated topic. Some traders argue that too much margin is very dangerous, however it all depends on trading style and the amount of trading experience one has. If you are going to trade on a margin account, it is important that you know what your broker's policies are on margin accounts, and that you fully understand and are comfortable with the risks involved. Be careful to avoid a Forex margin call.
All currency trading is done in pairs. Unlike the stock market, where you can buy or sell a single stock, you have to buy one currency and sell another currency in the forex market. Next, nearly all currencies are priced out to the fourth decimal point. A pip or percentage in point is the smallest increment of trade. One pip typically equals 1/100 of 1 percent.
One might sensibly ask why I'm posting it if it has all these limitations? The rationale here is that I want individuals of all levels to realise that building algorithmic trading systems is hard work and requires a lot of attention to detail! There is a significant amount of scope for introducing bugs and incorrect behaviour. I want to outline how "real world" systems are built and show you how to test for these errors and correct them.
Retail or beginning traders often trade currency in micro lots, because one pip in a micro lot represents only a 10-cent move in the price. This makes losses easier to manage if a trade doesn't produce the intended results. In a mini lot, one pip equals $1 and that same one pip in a standard lot equals $10. Some currencies move as much as 100 pips or more in a single trading session making the potential losses to the small investor much more manageable by trading in micro or mini lots.
In FX, the investor cannot attempt to buy on the bid or sell at the offer as is the case in exchange-based markets. On the other hand, once the price clears the cost of the spread, there are no additional fees or commissions. Every single penny gained is pure profit to the investor. Nevertheless, the fact that traders must always overcome the bid/ask spread makes scalping much more difficult in FX. 
Profit factor on the forex robot trading account statement. Profit factor is the gross profit / gross loss. E.g Profit of $6000 and a loss of $3000 would give a profit factor of 2.0. This means that for every $1 risked, you can expect a return of $2. If a forex robot has a profit factor less than 1, eg profit factor of 0.7, this means that for every $1 you can expect $0.70 back (the forex robot is a losing one!). If a forex robot has a high profit factor, it is a good one – eg profit factor of 6.0 ($6 gained for every $1 risked). You can click this table heading to rank the table of forex robots by the profit factor to see what are the best forex robots with the highest profit factor.

As you may now come to understand, FX margins are one of the key aspects of Forex trading that must not be overlooked, as they can potentially lead to unpleasant outcomes. In order to avoid them, you should understand the theory concerning margins, margin levels and margin calls, and apply your trading experience to create a viable Forex strategy. Indeed a well developed approach will undoubtedly lead you to trading success in the end.
In addition, I've had some comments from people suggesting that they'd like to see more varied order types than the simple Market Order. For carrying out proper HFT strategies against OANDA we are going to need to use Limit Orders. This will probably require a reworking of how the system currently executes trades, but it will allow a much bigger universe of trading strategies to be carried out.
All information on The Forex Geek website is for educational purposes only and is not intended to provide financial advice. Any statements about profits or income, expressed or implied, do not represent a guarantee. Your actual trading may result in losses as no trading system is guaranteed. You accept full responsibilities for your actions, trades, profit or loss, and agree to hold The Forex Geek and any authorized distributors of this information harmless in any and all ways. No representation is being made that any account will or is likely to achieve profits or losses similar to those shown. In fact, there are frequently sharp differences between hypothetical performance results and the actual results subsequently achieved by any particular trading program. Hypothetical trading does not involve financial risk, and no hypothetical trading record can completely account for the impact of financial risk in actual trading. This site provides unbiased reviews and may be compensated through third party advertisers. This compensation is not an endorsement or recommendation and TheForexGeek.com is not responsible for these websites. Your usage of The Forex Geek Website serves as your acknowledgement and representation that you have read and understood these TERMS OF USE and that you agree to be bound by such TERMS OF USE (“Agreement”). You accept that the agreement can be changed at any time and that you must comply with any changes made to the agreement.
After writing the last entry, I realised that I really wanted a way to be able to backtest forex strategies in much the same manner as I had demonstrated previously with equities via the event-driven backtester. I wanted there to be as minimal a difference between the live trading environment and the backtesting system. Hence I decided that I needed to build a Portfolio component that would reflect (as much as possible) the current state of the trading account as given by OANDA.
At this stage the "risk management" is rather unsophisticated! In the method calc_risk_position_size below we are simply making sure that the exposure of each position does not exceed risk_per_trade% of the current account equity. risk_per_trade defaults to 2% with the keyword argument, although this can obviously be changed. Hence for an account of £ 100,000, the risk per trade will not exceed £ 2,000 per position.
×