Doing interesting things for free - page 32

 
inoy:

Hello. Perhaps someone would be interested in writing the original trawl. I haven't found anything similar on the web. The actual ToR: both stop and profit moves (TralTP), but always only in the direction of the PRICE, i.e. the range on both sides only narrows. This is all simple, and the "trick" is that the trawl changes in % (and NOT in pips) of the SL or TP. Example: I have an open position with SL = 300, TP = 100 (total 400 pips = 100%, SL = 75%, TP = 25% of range). Price moved +50 pips, stop loss is set at 150 pips. 150 pips from the price, i.e. -100. In total the initial 3/1 ratio has been retained. The price has returned to the point of opening (0), to SL 100 points, it means we have to move TP to +33. So etc.

The price does not move by some fantastic jumps (+50, -50)... The technical specification is not solvable. Or rather, it can be solved, but it won't be what you want. The trawl will react to every tick and the range will narrow faster than you want it to. I'm not saying that it will get narrower on every tick, but as soon as you pass a few points, the range will get narrower. And I'm not even talking about five digits, the trawl will be even more sensitive to quotes and the range will narrow even faster.

 
I immediately thought of this, which is what the Step variable is for. The trail should not move in "a few points", but in a given % of the range, e.g. 25% of the current SL - TP. Alternatively, the task can be solved differently in general (as an option): the user should check the original P/L ratio in a user-specified time interval in minutes. The meaning will not change, and the essence of the idea remains the same. Better still, you can do both.
 
inoy:
I thought about it right away, that's what the Step variable is for. The trawl should not move in "a few points", but in a given % of the range, for example 25% of the current spread SL - TP. Alternatively, the task can be solved differently in general (as an option): the user should check the original P/L ratio in a user-specified time interval in minutes. The meaning will not change and the essence of the idea remains the same. Better still, you can do both.

Shit... Sorry... Misunderstood that parameter Step! :))

But still, I will write an out loud thought. You should not waste your time on trawling, but relying on technical analysis...

 
You may be right. But in addition to TA, there is also probabilistic analysis, which solves the problem of choice at different risk ratios. I got the idea for the trawl from the Shapiro test described by Elder.
 

Hello, I have found a good indicator, it gives a clear signal for 20 pips at least, but signals come very rarely and unexpectedly, I have no time to track them. I have tried to put an alert (beep) but it does not work, I wish I could use it as an Expert Advisor too! I have been using it for half a year and it is a good one! I have been using it for more than a year and it is a good one!

here is a miracle

Files:
 
DDEEDD:

I have found a good indicator, it gives a clear signal for 20 pips at least, but signals come very rarely and unexpectedly, I have no time to track them. I have tried to put an alert (beep) but it does not work, I wish I could use it as an Expert Advisor too! I have been using it for fifty years and it is a good one! I have been using it for more than a year and it is a good one!

here's a miracle.


The indicator peeks at 1 bar.

More precisely - it draws an entry point on the bar at which it checks the close price. which means that you will enter not at the open price of the bar, but at the close, that is 1 bar late.

this is what it analyses - the close price crossing the trawl line (at a distance of nPips) from the last flip

you are on a flat



 

I'm using an Expert Advisor along with it. Of course there are losses, but they are insignificant in comparison with the overall losses.

 

I found an interesting indicator in CodeBase and I would like to change it slightly.

Outputs to the upper right corner of the
working TF
ApPrise
DnPrise

Distance between lines in pips

Maybe who can remake it?

Files:
 
Hi all. I wanted to make a quick zigzag for my EA using XLab_ZZZ theme from the author of the thread. But XLab_ZZZ counts from the beginning of the history and I need the first two breaks on the right. I wrote it, but it's glitchy and I don't know where it is. Look at it with a naked eye, maybe you'll see where the error is. Look at opening prices.
//+------------------------------------------------------------------+
//|                                                   1+FZZ_test.mq4 |
//+------------------------------------------------------------------+

 int Step=30;
 string tmp,line[4]; int last_time_signal_ss,last_time_signal_bs;
 double p1,p2,p3,p4,p5; int mp, t1,t2,t3,t4,t5;
//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
     mp=1; if(Digits==3 || Digits==5)mp=10; 
     for (int i=0;i<4;i++)line[i]="Line"+Symbol()+"_"+i+"_ZZ";
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   DeleteObjects("ZZ");Comment("");
//----
   return(0);
  }

void DeleteObjects(string text) {
   string name;
   for (int i = ObjectsTotal() - 1; i >= 0; i--) {
      name = ObjectName(i);
      if (StringFind(name,text) > -1) ObjectDelete(name);
   }
}
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
  
  Signal();
 //_ObjectSet(line[0], p2,t2,Close[1],Time[0]);
 _ObjectSet(line[1], p3,t3,p2,t2);
 _ObjectSet(line[2], p4,t4,p3,t3);
 _ObjectSet(line[3], p5,t5,p4,t4);
//----
   return(0);
  }
//+------------------------------------------------------------------+
int Signal(){
int x,n;
p1=0;p2=0;p3=0;p4=0;p5=0; t1=0;t2=0;t3=0;t4=0;t5=0;
double hi=High[1], lo=Low[1], c=Close[1]; int th=0,tl=0;

for(int i=1; i<500;i++)
   {
    
    if(p2==0)
    {
    if(High[i]>hi){hi=High[i]; th=Time[i];}
    if(Low [i]<lo){lo=Low [i]; tl=Time[i];}
    if(hi-lo>Step*Point*mp)
      {
       if(c>lo && c<hi ){
                          if(th>tl){p2=hi;t2=th;p3=lo;t3=tl;}
                          if(tl>th){p2=lo;t2=tl;p3=hi;t3=th;}
                          continue;
                         }
       }
    }
    
    if(p2>0 && p4==0)
     {
     n=i;
       if(p3>p2){
                 if(p3-Low [n]>Step*Point*mp){p4=Low [n];t4=Time[n];continue;}
                 if(High[n]>p3)if(p3-Low [n]< Step*Point*mp){p3=High[n];t3=Time[n];}
                }  
       if(p3<p2){
                 if(High[n]-p3>Step*Point*mp){p4=High[n];t4=Time[n];continue;}
                 if(Low[n]<p3){p3=Low[n];t3=Time[n];}
                }  
     }
    
    if(p4>0)
      {
       x=i;
       if(p4>p3){
                 if(p4-Low [x]>Step*Point*mp){p5=Low [x];t5=Time[x];break;}
                 if(High[x]>p4){p4=High[x];t4=Time[x];}
                 
                }  
       if(p4<p3){
                 if(High[x]-p4>Step*Point*mp){p5=High[x];t5=Time[x];break;}
                 if(Low[x]<p4){p4=Low[x];t4=Time[x];}
                 
                }  
      }
    if(p5>0)break;
    
    }

return(0);}

void _ObjectSet(string name, double price1, int time1, double price2,int time2) {
   if(ObjectFind(name)!= -1)ObjectDelete(name); 
   ObjectCreate(name,OBJ_TREND,0,0,0,0,0);
   ObjectSet(name,OBJPROP_STYLE,STYLE_SOLID);
   ObjectSet(name,OBJPROP_COLOR,DodgerBlue);
   ObjectSet(name, OBJPROP_TIME1, time1);
   ObjectSet(name, OBJPROP_PRICE1, price1);
   ObjectSet(name, OBJPROP_TIME2, time2);
   ObjectSet(name, OBJPROP_PRICE2, price2);
   ObjectSet(name,OBJPROP_RAY,false); 
}
 
FION:
I wanted to make a quick zigzag for the EA based on the XLab_ZZZ theme from the author of the thread.

Firstly, you are counting in a wrong direction. Secondly, you have completely killed the purpose of my zigzag :)

You should feed the code from the indicator into the Expert Advisor directly as it is. Nothing will happen to the EA if it calculates the entire history (or since the specified bar) when it is launched.

Reason: