• Home
  • Forums
  • News
  • Calendar
  • Market
  • Login
  • Join
  • User/Email: Password:
  • 10:56pm
Menu
  • Forums
  • News
  • Calendar
  • Market
  • Login
  • Join
  • 10:56pm
Sister Sites
  • Metals Mine
  • Crypto Craft
  • Forex Factory

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

In Forex, what is pyramiding and rules against it? 6 replies

Pyramiding - coder needed 3 replies

pyramiding or scaling in, anyone? 0 replies

"Pyramiding" – When and When Not to Do it 1 reply

Pyramiding: A Risky Strategy 0 replies

  • Trading Systems
  • /
  • Reply to Thread
  • Subscribe
  • 6
Attachments: Pyramiding EA
Exit Attachments
Tags: Pyramiding EA
Cancel

Pyramiding EA

  • Last Post
  •  
  • 1 2 Page 3
  • 1 2 Page 3
  •  
  • Post #41
  • Quote
  • Nov 21, 2019 1:28pm Nov 21, 2019 1:28pm
  •  HeyYou
  • Joined Apr 2015 | Status: Member | 1,753 Posts
ok, here's the source code, it is a freaking old EA .. feel free to modify it, it is open source.

Inserted Code
extern int sl = 300;
extern int target = 1000;
extern int maxspread=26;
extern double lotss=0.01;
extern double maxlots=5;
extern bool buy=true;
extern bool first=true;
int B1,S1,firsb,firss;
int start()
   {
   double lots = ((AccountEquity()/sl)-0.01);
   double s = (Ask-Bid);
   double bl1 = 0;
   double sl1 = 0;
   B1=0;
   S1=0;
   firsb=0;
   firss=0;
  
   for(int o=0;o<OrdersTotal(); o++ )
   {
      if(OrderSelect(o, SELECT_BY_POS)==true)
         {      
           if (OrderSymbol()==Symbol() && OrderType()==OP_BUY)
           {
            B1++;
            bl1 += OrderLots();
           }
           if (OrderSymbol()==Symbol() && OrderType()==OP_SELL)
           {
            S1++;
            sl1 += OrderLots();
           }
           if (OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderMagicNumber()==1)
           {
            firsb++;
           }
           if (OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderMagicNumber()==1)
           {
            firss++;
           }
           if (s<maxspread*Point)
           {
           if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderMagicNumber()==1 && AccountEquity()>target)
           {
            OrderClose(OrderTicket(),OrderLots(),Bid,20,0);
           }
           if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderMagicNumber()==1 && AccountEquity()>target)
           {
            OrderClose(OrderTicket(),OrderLots(),Ask,20,0);
           }
           if(OrderSymbol()==Symbol() && OrderType()==OP_BUY && OrderMagicNumber()==2 && firsb==0)
           {
            OrderClose(OrderTicket(),OrderLots(),Bid,20,0);
           }
           if(OrderSymbol()==Symbol() && OrderType()==OP_SELL && OrderMagicNumber()==2 && firss==0)
           {
            OrderClose(OrderTicket(),OrderLots(),Ask,20,0);
           }
         }
      }
   }
  
   if (s<maxspread*Point  && lots<maxlots)
   {
   if (first==true && buy==true && B1+S1==0)
   {
   OrderSend(Symbol(),OP_BUY,lots,Ask,20,0,0,0,1);
   }
   if (first==true && buy==false && B1+S1==0)
   {
   OrderSend(Symbol(),OP_SELL,lots,Bid,20,0,0,0,1);
   }
   if (firsb>0 && bl1<lots)
   {
   OrderSend(Symbol(),OP_BUY,lotss,Ask,20,0,0,0,2);
   }
   if (firss>0 && sl1<lots)
   {
   OrderSend(Symbol(),OP_SELL,lotss,Bid,20,0,0,0,2);
   }  
}
return(0);
}
 
 
  • Post #42
  • Quote
  • Nov 21, 2019 2:45pm Nov 21, 2019 2:45pm
  •  auricforecas
  • Joined Sep 2017 | Status: Still a total mystery | 3,575 Posts
Quoting HeyYou
Disliked
ok, here's the source code, it is a freaking old EA .. feel free to modify it, it is open source. extern int sl = 300; extern int target = 1000; extern int maxspread=26; extern double lotss=0.01; extern double maxlots=5; extern bool buy=true; extern bool first=true; int B1,S1,firsb,firss; int start() { double lots = ((AccountEquity()/sl)-0.01); double s = (Ask-Bid); double bl1 = 0; double sl1 = 0; B1=0; S1=0; firsb=0; firss=0; for(int o=0;o<OrdersTotal(); o++ ) { if(OrderSelect(o, SELECT_BY_POS)==true) { if (OrderSymbol()==Symbol() && OrderType()==OP_BUY)...
Ignored
Tnx man, have you tried to test it in current MT4 version(s)? I had some problems (with re-compiling, with some of my TEs that were written LONG ago, the base of it) with some of my code when MT4/MQL4 version updated...

Quoting jhonayahya
Disliked
Not working on strategy tester
Ignored
If I understand correctly, it is Money Managing component of a trading so you can not test it as a stand-alone trading system... it is "just" (possible powerful/useful) a component/module.. to (in addition to) trading system, TE etc... If I understand correctly..
Can you afford to take that chance?
 
 
  • Post #43
  • Quote
  • Apr 22, 2020 5:17pm Apr 22, 2020 5:17pm
  •  LarryWilliam
  • | Joined Dec 2019 | Status: Member | 18 Posts
Quoting auricforecas
Disliked
{quote} Yeah, can you imagine, if you could get that many of downloads in very specific forum, thread... what could you get in more mainstream... Yeah, joking? But you get the idea... Yes, Money Management is very important... without it, some trader that might have the edge.. might seem fail due to the poor Money Management... In fact, remember at least one trader that left the pursue of finding of finding the holy grail or how to read the market and he focused on Money Management instead... AT the end he said that basically... price direction...
Ignored
So I placed this EA in a 10k demo account with the default settings and left it for 7 days and when I came back and checked BOOM it had 17,000


Attached Image (click to enlarge)
Click to Enlarge

Name: CCE317C9-C152-4E76-B457-D93802181ADA.png
Size: 175 KB
Money management is the easiest to learn but means life or death!
 
1
  • Post #44
  • Quote
  • Jun 27, 2021 6:34am Jun 27, 2021 6:34am
  •  joyny
  • Joined Nov 2019 | Status: Member | 671 Posts
Thinking about this occasionally. Making some EAs to hunt for extremely rare but highly profitable entries.. Would be good to make from 100 $ to 400 000 $ with 12 great trades in a row.

100
200
400
800
1600
3200
6400
12800
25600
51200
102400
204800
409600

Better to stop on 800 or 1600. And then restart. For example, start with 1000 $, split into 10 parts by 100$. So have 10 attempts.
When at the end of some iteration have doubled initial capital - then double starting part.

Should be done gradually. Otherwise when starting from 100$ and losing 102400 $ then this would be killing for emotional wellbeing.

3x wins in a row is very doable. 4x harder. 5x very hard.
 
 
  • Post #45
  • Quote
  • Jul 24, 2021 11:08pm Jul 24, 2021 11:08pm
  •  fxtradernoob
  • | Joined Jul 2021 | Status: Junior Member | 2 Posts
Quoting LarryWilliam
Disliked
{quote} So I placed this EA in a 10k demo account with the default settings and left it for 7 days and when I came back and checked BOOM it had 17,000 {image}
Ignored
What is this EA that is on the screenshot of the photo
 
 
  • Post #46
  • Quote
  • Feb 11, 2023 7:47pm Feb 11, 2023 7:47pm
  •  mattrader
  • | Joined Sep 2007 | Status: Member | 508 Posts
Quoting HeyYou
Disliked
ok, here's the source code, it is a freaking old EA .. feel free to modify it, it is open source. extern int sl = 300; extern int target = 1000; extern int maxspread=26; extern double lotss=0.01; extern double maxlots=5; extern bool buy=true; extern bool first=true; int B1,S1,firsb,firss; int start() { double lots = ((AccountEquity()/sl)-0.01); double s = (Ask-Bid); double bl1 = 0; double sl1 = 0; B1=0; S1=0; firsb=0; firss=0; for(int o=0;o<OrdersTotal(); o++ ) { if(OrderSelect(o, SELECT_BY_POS)==true) { if (OrderSymbol()==Symbol() && OrderType()==OP_BUY)...
Ignored
Thanks for the sharing.
 
 
  • Post #47
  • Quote
  • Last Post: Feb 12, 2023 8:43am Feb 12, 2023 8:43am
  •  dieguito80
  • | Joined Oct 2017 | Status: Member | 57 Posts
Nice trhead Once i have Reed on sir Moneyzilla's trhead that the difference between Every top and bottom of Every candle in the end Is maximum One pip!and i can Believe It.
Now ..let s assume that Is true the next question Is how search any sort of hedge from that?
Maybe we could Place a grid of a buy and sell in the same position Every X pips(and adjust the interval of each level in reguard at the volatility,more Speed more space for each interval)than cash the winning position and let It run the looser one until the market retrace back and sum of all Is in profit and restart all the cicle from zero
 
 
  • Trading Systems
  • /
  • Pyramiding EA
  • Reply to Thread
    • 1 2 Page 3
    • 1 2 Page 3
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About EE
  • Mission
  • Products
  • User Guide
  • Blog
  • Contact
EE Products
  • Forums
  • Calendar
  • News
  • Market
EE Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow EE
  • Facebook
  • Twitter

EE Sister Sites:

  • Metals Mine
  • Crypto Craft
  • Forex Factory

Energy EXCH™ is a brand of Fair Economy, Inc.

Terms of Service / ©2023