Thema: Neues Projekt
Einzelnen Beitrag anzeigen
  #8 (permalink)  
Alt 10.01.22
Sirocool Sirocool ist offline
Mitglied
 
Registriert seit: Feb 2014
Ort: Berlin
Beiträge: 42
Sirocool befindet sich auf einem aufstrebenden Ast
Standard Projekt RSI

RSI wurde bearbeitet aber den Fehler das die Signal mal unten angzeigt werden und mal oben kann ich noch nicht beantworten bei folgen Symbolen kommen die Signale oben Gold;Eth bei Symbolen kommen Signale nur unten :-( EURUSD,u.s.w.

Overbought & Oversould Linien sind zu
100 %

Signale für Sell und Buy sind zu
100 %

Show Arrows zu
85 %

Alert zu
0%

Telegramm
0%

Preislinie zu
0%

RSI Channel zu
0% da ich erstmal schauen muss wie ich das Transperrent bekomme und das es Nicht an der Aktuellen Kerze stehen bleibt und erst wandert wenn die kerze vorbei ist.

Bild kommt dazu wie es jetzt auszieht und wie ich es haben möchte :-).

Code:
//+------------------------------------------------------------------+
//|                 SHARK_RSI_CLASSIC_V.22 - 0122                    |
//|                         Copyright 2020                           |
//|                     www.expert-advisor.com                       |
//+------------------------------------------------------------------+

#property copyright "Sirocool"
#property link      "http://www.expert-advisor.com/forum/members/sirocool.html"

//#property icon "\\Images\\Icon\\Shark.ico"

extern string  a_SHARK_SETTINGS ="~~* RSI Settings *~~";

extern int Fast_Length = 14;
extern int Over_Up = 30;
extern int Over_Dn = 70;

extern ENUM_APPLIED_PRICE SOURCE = PRICE_CLOSE;

extern string  b_SHARK_SETTINGS ="~~* RSI Settings Styl *~~";



extern string  c_SHARK_SETTINGS ="~~* RSI Settings Alert *~~";

extern bool ShowArrows    = true;


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

#property indicator_separate_window
#property indicator_buffers  3

#property indicator_minimum 0
#property indicator_maximum 100

//+------------------------------------------------------------------+
//| ENUM_APPLIED_PRICE                                               |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
string PriceTypeToString(int pt)
  {
   string answer;
   switch(pt)
     {
      case 0:
         answer = "Close"    ;
         break;
      case 1:
         answer = "Open"     ;
         break;
      case 2:
         answer = "High"     ;
         break;
      case 3:
         answer = "Low"      ;
         break;
      case 4:
         answer = "Median"   ;
         break;
      case 5:
         answer = "Typical"  ;
         break;
      case 6:
         answer = "Wighted"  ;
         break;
      default:
         answer = "Invalid price field requested";
         Alert(answer);
     }
   return(answer);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| IndicatorShortName                                               |
//+------------------------------------------------------------------+
string Name ="SHARK_RSI_CLASSIC_V.21"+"( "+ Fast_Length +","+PriceTypeToString(SOURCE)+","+ Over_Up+","+Over_Dn+")";
int windowIndex=WindowFind(Name),maxArrows;

//==================================== rectangle names
string NameTopLev=windowIndex+"LevelTop";       //50 -
string NameWaitUp=windowIndex+"LevelWaitTop";   // 55
string NameWaitLo=windowIndex+"LevelWaitBot";   //-45
string NameBotLev=windowIndex+"LevelBot";       //30




double SHARK_BUFFER_M[],SHARK_BUFFER_ARROW_UP[],SHARK_BUFFER_ARROW_DN[];
bool ExtParameters=false, initFinished=false;

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorBuffers(3);
   IndicatorDigits(Digits);//max. 2

   SetIndexBuffer(0,SHARK_BUFFER_M,INDICATOR_DATA); // RSI_LINIE
   SetIndexStyle(0,DRAW_LINE,EMPTY,1,clrRoyalBlue);
   SetIndexDrawBegin(0,Fast_Length);
   SetIndexLabel(0,"RSI");

   SetIndexBuffer(1,SHARK_BUFFER_ARROW_UP,INDICATOR_DATA);
   SetIndexStyle(1, DRAW_ARROW, EMPTY,1,clrForestGreen);
   SetIndexArrow(1, 241);
   SetIndexLabel(1,NULL);

   SetIndexBuffer(2,SHARK_BUFFER_ARROW_DN,INDICATOR_DATA);
   SetIndexStyle(2, DRAW_ARROW, EMPTY,1,clrFireBrick);
   SetIndexArrow(2, 242);
   SetIndexLabel(2,NULL);


   if(Fast_Length<=1)
     {
      Print("Wrong input parameters");
      ExtParameters=false;
      return(INIT_FAILED);
     }
   else
      ExtParameters=true;

   return(INIT_SUCCEEDED);

   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
  {
   DeleteArrows();
//ObjectsDeleteAll();
//ObjectDelete();
//deleteArrows();
   return(0);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
   _Overlines(Over_Up,Over_Dn,false);



   int counted_bars=IndicatorCounted(),limit,i;

   if(counted_bars<0)
      return(-1);
   if(counted_bars>0)
      counted_bars--;

   limit=MathMin(Bars-counted_bars,Bars-1);

   for(i = limit; i >= 0 && !IsStopped(); i--)
     {
      SHARK_BUFFER_M[i] = iRSI(Symbol(),Period(),Fast_Length,SOURCE,i);

      //+------------------------------------------------------------------+
      //| SHARK_SHOW_ARROWS                                                |
      //+------------------------------------------------------------------+
      if(ShowArrows)
        {
         //+------------------------------------------------------------------+
         //| SHARK_SHORT_SIGNAL                                               |
         //+------------------------------------------------------------------+
         if((SHARK_BUFFER_M[i] < Over_Dn) && (SHARK_BUFFER_M[i+1] > Over_Dn))
           {
            SHARK_BUFFER_ARROW_DN[i+1] = High[i+1]+90;
           }
         if((SHARK_BUFFER_M[i] < Over_Dn) && (SHARK_BUFFER_M[i+1] > Over_Dn))
           {
            DrawArrow(i+1,"Dn");
           }
         //+------------------------------------------------------------------+
         //| SHARK_LONG_SIGNAL                                                |
         //+------------------------------------------------------------------+
         if((SHARK_BUFFER_M[i] > Over_Up) && (SHARK_BUFFER_M[i+1] < Over_Up))
           {
            SHARK_BUFFER_ARROW_UP[i+1] = Low[i+1]+5;
           }
         if((SHARK_BUFFER_M[i] > Over_Up) && (SHARK_BUFFER_M[i+1] < Over_Up))
           {
            DrawArrow(i+1,"Up");
           }

        }

     }

   return(0);
  }
//+------------------------------------------------------------------+
//| Extras                                                           |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Overline 70 / 30                                                 |
//+------------------------------------------------------------------+
void _Overlines(int Up, int Dn)
  {
   if(initFinished==false)
     {
      IndicatorShortName(Name);
      windowIndex=WindowFind(Name);

      if(windowIndex<0)
        {
         Print("Can\'t find window");
         return;
        }
      ObjectCreate("OVERSOLDLINE",OBJ_HLINE,windowIndex,0,Up);
      ObjectSet("OVERSOLDLINE",OBJPROP_COLOR,clrGreen);
      ObjectSet("OVERSOLDLINE",OBJPROP_WIDTH,1);
      ObjectSet("OVERSOLDLINE",OBJPROP_STYLE,STYLE_DOT);
      
      ObjectCreate("SHORTLINE",OBJ_HLINE,windowIndex,0,Up+10);
      ObjectSet("SHORTLINE",OBJPROP_COLOR,C'128,128,128');
      ObjectSet("SHORTLINE",OBJPROP_WIDTH,1);
      ObjectSet("SHORTLINE",OBJPROP_STYLE,STYLE_DOT);
      
      ObjectCreate("LONGLINE",OBJ_HLINE,windowIndex,0,Dn-10);
      ObjectSet("LONGLINE",OBJPROP_COLOR,C'128,128,128');
      ObjectSet("LONGLINE",OBJPROP_WIDTH,1);
      ObjectSet("LONGLINE",OBJPROP_STYLE,STYLE_DOT);

      ObjectCreate("OVERBOUGHTLINE",OBJ_HLINE,windowIndex,0,Dn);
      ObjectSet("OVERBOUGHTLINE",OBJPROP_COLOR,clrRed);
      ObjectSet("OVERBOUGHTLINE",OBJPROP_WIDTH,1);
      ObjectSet("OVERBOUGHTLINE",OBJPROP_STYLE,STYLE_DOT); 
     }
  }
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| Show Arrows                                                      |
//+------------------------------------------------------------------+
void DrawArrow(int i,string type)
  {
   maxArrows++;
   ObjectCreate("RSISignal"+maxArrows,OBJ_ARROW,0,Time[i],0);
   if(type=="Dn")
     {
      ObjectSet("RSISignal"+maxArrows,OBJPROP_PRICE1,High[i]+10);
      ObjectSet("RSISignal"+maxArrows,OBJPROP_ARROWCODE,242);
      ObjectSet("RSISignal"+maxArrows,OBJPROP_COLOR,clrRed);
     }
   else
      if(type=="Up")
        {
         ObjectSet("RSISignal"+maxArrows,OBJPROP_PRICE1,Low[i]-10);
         ObjectSet("RSISignal"+maxArrows,OBJPROP_ARROWCODE,241);
         ObjectSet("RSISignal"+maxArrows,OBJPROP_COLOR,clrGreen);
        }
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void DeleteArrows()
  {
   while(maxArrows>0)
     {
      ObjectDelete("RSISignal"+maxArrows);
      maxArrows--;
     }
  }


//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+