extern double MA_length = 10;
extern double slip = 0;
extern double Lots = 1;
extern double TakeProfit = 30;
extern double Stoploss = 2000;
extern double PipStep = 30;
double PriceTargetOld=9999999;
int start()
{
// код доступен только после оплаты
}
double PriceTarget;
double AveragePrice;
int OpeningDay;
double Tester;
double Stopper=0;
int cnt=0, total;
total=OrdersTotal();
if(total==0) OpeningDay=DayOfYear();
OrderSelect(total-1, SELECT_BY_POS);
double LastPrice=OrderOpenPrice();
OrderSelect(total, SELECT_BY_POS, MODE_TRADES);
if((iMA(NULL,0,MA_length,0,MODE_SMA,PRICE_HIGH,1)*1.02)<Bid && (Bid>=(LastPrice+(PipStep*Point))||total==0)) // Go SHORT -> Only sell if >= 30 pips above previous position entry
{
OrderSend(Symbol(),OP_SELL,Lots,Bid,slip,Bid+(Stoploss*Point),Bid-(TakeProfit*Point),0,0,Red);
}
if((iMA(NULL,0,MA_length,0,MODE_SMA,PRICE_OPEN,0)*0.98)>Ask && (Ask<=(LastPrice-(PipStep*Point))||total==0)) // Go LONG -> Only buy if >= 30 pips below previous position entry
{
OrderSend(Symbol(),OP_BUY,Lots,Ask,slip,Ask-(Stoploss*Point),Ask+(TakeProfit*Point),0,0,Blue);
}
total=OrdersTotal();
AveragePrice=0;
if(total>0)
{
for(cnt=0;cnt<total;cnt++)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
AveragePrice=AveragePrice+Показано первые 50% кода (символов: 2171)
Введите ваш email и нажмите кнопку, чтобы перейти к оплате.