Einzelnen Beitrag anzeigen
  #31 (permalink)  
Alt 29.01.15
Benutzerbild von markusrgb
markusrgb markusrgb ist offline
Mitglied
 
Registriert seit: Jan 2015
Beiträge: 34
markusrgb befindet sich auf einem aufstrebenden Ast
Standard

Zitat:
Zitat von pako Beitrag anzeigen
Code:
//+------------------------------------------------------------------+
//| The script prints information on symbol                           |
//+------------------------------------------------------------------+
void OnStart()
  {

   Print("Stop level in points=",MarketInfo(Symbol(),MODE_STOPLEVEL));
  
  }
min stop ??

konto, demo oder real?

wenn demo - login, pass, server
sorry, aber aus diesen paar Wortfetzten kann ich ich nicht wirklich denn sinn hinter deiner Frage erkennen

Ich teste das natürlich auf einem DemoKonto


min stop ??

?? Print("Stop level in points=",MarketInfo(Symbol(),MODE_STOPLEVEL)); ?? was frag das ab?

wenn demo - login, pass, server ?? was meinst damit?



Netter Code, aber für mich als anfänger nicht auf anhieb zu durchschauen
werds auf jeden fall mal bei gelgegenheit versuchen es zu verstehn und zu Analysieren
aber ein paar // hinter denn zeilen würden mir die sache leichter machen
Code:
//+------------------------------------------------------------------+
//|                                                        daxV1.mq4 |
//|                        Copyright 2015, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2015, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property strict
int countB,countS;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---

  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   countB=0;
   countS=0;
   for(int pos=OrdersTotal()-1; pos>=0; pos--)
     {
      if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES))
         if(OrderSymbol()==Symbol())
           {
            if(OrderType()==OP_BUY)
              {
               countB++;
               if(OrderStopLoss()==0)
                 {
                  bool res=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()-(OrderOpenPrice()/100)*0.5,Digits),0,0,Blue);
                  if(!res)
                     Print("Error in OrderModify. Error code=",GetLastError());
                  else
                     Print("Order modified successfully.");
                 }
              }
            if(OrderType()==OP_SELL)
              {
               countS++;
               if(OrderStopLoss()==0)
                 {
                  bool res=OrderModify(OrderTicket(),OrderOpenPrice(),NormalizeDouble(OrderOpenPrice()+(OrderOpenPrice()/100)*0.5,Digits),0,0,Blue);
                  if(!res)
                     Print("Error in OrderModify. Error code=",GetLastError());
                  else
                     Print("Order modified successfully.");
                 }
              }
           }
     }
//--------------------------------------------------------------+
   if(countB==0) int ticket=OrderSend(Symbol(),OP_BUY,1.0,Ask,30,0,0,"buy",16384,0,clrGreen);

   if(countS==0) int ticket=OrderSend(Symbol(),OP_SELL,1.0,Bid,30,0,0,"sell",16384,0,clrGreen);
//--------------------------------------------------------------+

  }
//+------------------------------------------------------------------+