指定
User Inputs
Comment default PB
Timeframe (current, m1,m5,m15,m30,h1,d1,w1,m1)
MoneyManagement - true/false (if true then use risk else use lotsize)
LotSize default 0.01
MaxLotSize default 100.00
Risk default 50 values 1 - 200 (risk100 = 10lots per 10k)
MagicNumber default 333 (EA will only manage trades with this magic number)
CloseAtWeekend true/false (closes all orders when market is closed to avoid weekend gaps) default true
AlertsActive true/false (if true EA will send push notification only)* default true
AutoStopLoss true/false (if true then place SL as per image else use StopLoss) default true
StopLoss default 10 (value in pips)
//Powerplay settings (external inputs as above)
PPLength default PP
PPPeriod default PP
PPDeviation default PP
*notification will show "Comment Symbol Profit(including account currency)"
Strategy
Please see attached image.
If AutoStopLoss = true strategy will follow the PowerPlay indicator. When a SELL arrow is drawn a SELL order will be placed with a SL immediately where the arrow was drawn. This position will stay open until it reaches the SL or Powerplay draws a BUY arrow. When the BUY arrow is drawn, the SELL position will close and then the EA will immediately open a BUY order with a SL immediately where the arrow was drawn. This continues until the EA is disabled.
If AutoStopLoss = false then the same strategy will be followed except the SL will be placed the value of StopLoss away.
Things to note
- When the EA starts it should wait for the next arrow before placing an order.
- As soon as an arrow is drawn, the order should be placed.
- When the EA is disabled,terminal closed or CloseAtWeekend is true then all orders should be closed (in profit or not).
- There should never be anymore than 1 order open at the same time, we must ensure that before a new order is placed, the previous order has closed.
- If a SL is hit then the EA will wait for the next change in direction to place an order.
- If closing an order fails then issue an alert (if AlertsActive is true or false). The EA should continue trying to close the order until it succeeds.
- There are no trailing stops or take profits placed
- Full source code must be supplied
Powerplay Buffers
double UpBuffer = iCustom(NULL,0,"Powerplay.ex4","Indicator settings",PPLength,PPPeriod,PPDeviation,false,false,true,3,0);
double DownBuffer = iCustom(NULL,0,"Powerplay.ex4","Indicator settings",PPLength,PPPeriod,PPDeviation,false,false,true,4,0);