SuperSinyalBUYSELL

Author: alterations by Mark Tomlinson
Orders Execution
Checks for the total of open ordersIt Closes Orders by itself It automatically opens orders when conditions are reached
Miscellaneous
Implements a curve of type %1It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites

Profitability Reports

AUD/USD Oct 2024 - Jan 2025
0.00 %
Total Trades 0
Won Trades 0
Lost trades 0
Win Rate 0.0 %
Expected payoff 0.00
Gross Profit 0.00
Gross Loss 0.00
Total Net Profit 0.00
-100%
-50%
0%
50%
100%
SuperSinyalBUYSELL
/* Begin SuperSinyal v2 Alert Ýndicators

//+------------------------------------------------------------------+
//|                                             super-signals_v2.mq4 |
//|                Copyright © 2006, Nick Bilak, beluck[AT]gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Nick Bilak"
#property copyright "alterations by Mark Tomlinson"
#property link      "http://www.forex-tsd.com/"

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Orange
#property indicator_color2 Yellow
#property indicator_color3 Magenta
#property indicator_color4 LightYellow
//input properties

extern int dist2=21;
extern int dist1=14;
extern bool sounds=true;
extern bool exitsounds=true;
double b1[];
double b2[];
double b3[];
double b4[];
double alertTag;


int init()  {
   SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,2);
   SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,2);
   SetIndexStyle(2,DRAW_ARROW,STYLE_SOLID,2);
   SetIndexStyle(3,DRAW_ARROW,STYLE_SOLID,2);
   SetIndexArrow(1,333);
   SetIndexArrow(0,334);
   SetIndexArrow(1,233);
   SetIndexArrow(0,234);
   SetIndexBuffer(0,b1);
   SetIndexBuffer(1,b2);
   SetIndexBuffer(2,b3);
   SetIndexBuffer(3,b4);
   return(0);
}
int start() {
   int counted_bars=IndicatorCounted();
   int k,i,j,limit,hhb,llb,hhb1,llb1;
   
   if (counted_bars<0) return(-1);
   if (counted_bars>0) counted_bars--;
   limit=Bars-1;
   if(counted_bars>=1) limit=Bars-counted_bars-1;
   if (limit<0) limit=0;

   for (i=limit;i>=0;i--)   {
      hhb1 = Highest(NULL,0,MODE_HIGH,dist1,i-dist1/2);
      llb1 = Lowest(NULL,0,MODE_LOW,dist1,i-dist1/2);
      hhb= Highest(NULL,0,MODE_HIGH,dist2,i-dist2/2);
      llb= Lowest(NULL,0,MODE_LOW,dist2,i-dist2/2);

      if (i==hhb){
         b1[i]=High[hhb]+10*Point;
         if(sounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Yukarý!.. ",Symbol()," Period ",Period()," i= ",i);
         alertTag = Time[0];
         }
      if (i==llb){
         b2[i]=Low[llb]-10*Point;
        if(sounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Aþaðý!.. ",Symbol()," Period ",Period()," i= ",i);
        alertTag = Time[0];
         }
      if (i==hhb1){
         b3[i]=High[hhb1]+4*Point;
        if(exitsounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Buy Emrini Kapat ",Symbol()," Period ",Period()," i= ",i);
       alertTag = Time[0];
         }
      if (i==llb1){
         b4[i]=Low[llb1]-4*Point;
      if(exitsounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Sell Emrini Kapat ",Symbol()," Period ",Period()," i= ",i);
      alertTag = Time[0];
         }
      }       
  return(0);
}


// End SuperSinyal v2 Alert Ýndicators
*/
static int prevtime=0;
extern int SignalGap = 4;
double gd_224 = 0.0;
int dist=24;
extern int dist1=14;
int durum=0;
string sonsinyal="";
int sinyal=1;
extern int HedefLotSayi=20;
extern double HedefLot=0.20;
extern double HedefKar=19.00;
extern double HedefZarar=75.00;
extern double HedefZararPip=15.00;
extern double HedefKarPip=15.00;
   int ticket,k,i,j,limit,hhb,llb,hhb1,llb1;
int init()  {
      hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);
      llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);
          if (hhb>llb) sonsinyal="BUY";
          if (hhb<llb) sonsinyal="SELL";

}
int HepsiniKapat(int durum)
{

  int total = OrdersTotal();
   for(int i=total-1;i>=0;i--)
  {
     OrderSelect(i, SELECT_BY_POS);
    int type   = OrderType();

    bool result = false;
    
    switch(type)
    {
      //Close opened long positions
      case OP_BUY       : if (durum==1)result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
                          break;
      
      //Close opened short positions
      case OP_SELL      : if (durum==2)result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );
                          break;

      //Close pending orders
      case OP_BUYLIMIT  :
      case OP_BUYSTOP   :
      case OP_SELLLIMIT :
      case OP_SELLSTOP  : result = OrderDelete( OrderTicket() );
    }
    
    if(result == false)
    {
      Alert("Order " , OrderTicket() , " failed to close. Error:" , GetLastError() );
      Sleep(3000);
    }  
  }
  
  return(0);
}
int start()
 {
   limit=Bars-1;
//print("limit=",limit);
   if (limit<0) limit=0;

/*
 for (i=limit;i>=0;i--)   {
      hhb1 = Highest(NULL,0,MODE_HIGH,dist1,i-dist1/2);
      llb1 = Lowest(NULL,0,MODE_LOW,dist1,i-dist1/2);
      hhb= Highest(NULL,0,MODE_HIGH,dist2,i-dist2/2);
      llb= Lowest(NULL,0,MODE_LOW,dist2,i-dist2/2);

      if (i==hhb){
         b1[i]=High[hhb]+10*Point;
         if(sounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Yukarý!.. ",Symbol()," Period ",Period()," i= ",i);
         alertTag = Time[0];
         }
      if (i==llb){
         b2[i]=Low[llb]-10*Point;
        if(sounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Aþaðý!.. ",Symbol()," Period ",Period()," i= ",i);
        alertTag = Time[0];
         }
      if (i==hhb1){
         b3[i]=High[hhb1]+4*Point;
        if(exitsounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Buy Emrini Kapat ",Symbol()," Period ",Period()," i= ",i);
       alertTag = Time[0];
         }
      if (i==llb1){
         b4[i]=Low[llb1]-4*Point;
      if(exitsounds==true && i == 1 && alertTag!=Time[0]) Alert("Super Signals Sell Emrini Kapat ",Symbol()," Period ",Period()," i= ",i);
      alertTag = Time[0];
         }
      }       

*/

   if (Time[0]==prevtime) return(0);
   prevtime=Time[0];
Print("Burda");
//if (OrdersTotal()>= HedefLotSayi) return(0); 
//   limit=Bars-1;
   Print("Limit Bars",limit,"bars=",Bars);
      hhb = Highest(NULL,0,MODE_HIGH,dist,i-dist/2);
      llb = Lowest(NULL,0,MODE_LOW,dist,i-dist/2);
      hhb1 = Highest(NULL,0,MODE_HIGH,dist1,i-dist1/2);
      llb1 = Lowest(NULL,0,MODE_LOW,dist1,i-dist1/2);

   //if (Time[0]==prevtime) return(0);
   //   prevtime=Time[0];
    //   Print("hhb=",hhb,"llb=",llb);
/*{          if ((sonsinyal=="SELL") && (hhb>llb))
          {
           Alert("Super Signal Buy Fiyat=",Ask);sonsinyal="BUY";
          //HepsiniKapat();
          ticket=OrderSend(Symbol(),OP_BUY,HedefLot,Ask,3,Ask-135*Point,Ask+30*Point,"HaskayaFxbuy"+Symbol(),16384,0,Green);
            }
          if ((sonsinyal=="BUY") && (hhb<llb)) 
          {
          //HepsiniKapat();
          Alert("Super Signal SELL Fiyat=",Bid);sonsinyal="SELL";
          ticket=OrderSend(Symbol(),OP_SELL,HedefLot,Bid,3,Bid-135*Point,Bid-30*Point,"HaskayaFxSell"+Symbol(),16384,0,Green);
          
          }
*/           

          if (limit==hhb) ticket=OrderSend(Symbol(),OP_BUY,HedefLot,Ask,3,Ask-HedefZarar*Point,Ask+HedefKar*Point,"HaskayaFxbuy"+Symbol(),16384,0,Green);
          if (limit==llb) ticket=OrderSend(Symbol(),OP_SELL,HedefLot,Bid,3,Bid-HedefZarar*Point,Bid-HedefKar*Point,"HaskayaFxSell"+Symbol(),16384,0,Green);
          if (limit==hhb1) {durum=1;HepsiniKapat(durum);}//ticket=OrderSend(Symbol(),OP_BUY,HedefLot,Ask,3,Ask-HedefZarar*Point,Ask+HedefKar*Point,"HaskayaFxbuy"+Symbol(),16384,0,Green);
          if (limit==llb1) {durum=1;HepsiniKapat(durum);}//ticket=OrderSend(Symbol(),OP_SELL,HedefLot,Bid,3,Bid-HedefZarar*Point,Bid-HedefKar*Point,"HaskayaFxSell"+Symbol(),16384,0,Green);
          
          
  
          //if (hhb<llb) Alert("Super Signal SELL Fiyat=",Bid);
         // if (hhb>llb) Alert("Super Signal Buy Fiyat=",Ask);

    return(0);
}


//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+

Comments

Markdown supported. Formatting help

Markdown Formatting Guide

Element Markdown Syntax
Heading # H1
## H2
### H3
Bold **bold text**
Italic *italicized text*
Link [title](https://www.example.com)
Image ![alt text](image.jpg)
Code `code`
Code Block ```
code block
```
Quote > blockquote
Unordered List - Item 1
- Item 2
Ordered List 1. First item
2. Second item
Horizontal Rule ---