仕事が完了した
指定
订购MetaTrader 4的自动交易程序
依据当前1小时K线图上的Parabolic SAR指标进行自动交易程序的设计。
当价格上穿抛物线指数时买入(或价格下穿抛物线指数时卖出),止赢设30-300点之间(请告之如何更改止赢点数以及交易手数),止损则根据当时抛物线指数设定,并且止损能随抛物线指数递增(或递减)时做即时更改成移动止损。
请在编程时考虑买入和卖出的点差(或告之如何更改),以免建仓价格与K线图显示不一致。
具体要求:
1.交易品种从当前的K线图上读取;
2.当符合建仓条件时,但已有同向仓位,不建新的头寸,继续持原有仓位,只更改止赢和止损(止损则根据当时抛物线指数设定);若持有的是反向仓位,则平仓同时建立新的仓位;
3.在执行自动交易系统时,如果当前头寸止损了,就建立反向仓位,同时设定止赢和止损(止损则根据当时抛物线指数设定),如此循环的交易;
4.当现有头寸止赢了,就继续等待符合建仓条件时再建仓。
An Expert Advisor abour ordering MetaTrader4
I’m expecting for a design about an EA which can trade automaticly according to the Parabolic SAR index on the current K line.
When the price of candlesticks on the k-line crosses Parabolic index in an upward direction, open a buy position. When the price crosses Parabolic index in a downward direction, open a sell position. After open a position, set a 300 points’ fixed stop-profit, and the Stop-Loss is set according to the current Parabolic index, and it can timely change with progressive increase or decrease of the Parabolic index.
Detailed requirements:
1.The trading style can be read from the current k-line chart.
2.When the conditions of opening a position is matched, but the position in the same direction has already existed, then don’t continue holding the quondam position, only change the Stop-Profit and Stop-Loss (Stop-Loss is set according to the current parobolic index). If holding the reverse position, set a new position at the same time when close the previous position.
3.When operate the Expert Advisor, if the current position has stopped loss, set a reverse position at the time it stopped, and set the Stop-Profit and Stop-Loss at the same time (the Stop-Loss is set by the current Parobolic index), trading in this kind of circulation.
4.If the position has stopped profit, continue waiting for the matched condition and then set the new position.