hit_and_run

Orders Execution
It automatically opens orders when conditions are reachedChecks for the total of open ordersIt Closes Orders by itself
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%
GBP/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%
NZD/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%
hit_and_run
//+--------------------------------------------------------------------------------------------------+
//|                                                        Hit and Run Scalper                       |
//|This EA don't work on real accounts it is intended to make funny millionaires demo statements only|
//|                                                                                                  |
//+--------------------------------------------------------------------------------------------------+
//
extern double risk=90;
extern int MagicNumber=3329838;
extern int StopLoss=15;
extern int TakeProfit=15;

int i,cnt;
int lotsize,AccNumber,Leverage;
double old_bid=0,curr_bid=0,old_ask=0,curr_ask=0;
double up_trend=0,down_trend=0,LotRisk,Balance;
double MaxLots,LotStep,MinLots,lotsi;
string AccountText,AccName;
//+------------------------------------------------------------------+

int init()
{
   AccNumber=AccountNumber();
   Leverage=AccountLeverage();
   AccName=AccountName();
   MinLots=NormalizeDouble(MarketInfo(Symbol(),23),2);
   LotStep=NormalizeDouble(MarketInfo(Symbol(),24),2);
   MaxLots=NormalizeDouble(MarketInfo(Symbol(),25),2);
   lotsize=MarketInfo( Symbol(), MODE_LOTSIZE );
   Lotsi(); 
return(0);
}

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

int deinit()
{
return(0);
}

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

int start()
{   
curr_bid = NormalizeDouble(Bid,Digits);
curr_ask = NormalizeDouble(Ask,Digits);
up_trend = curr_bid - old_ask;
down_trend = old_bid - curr_ask;

if (up_trend > 0.0)   i = OrderSend(Symbol(),OP_BUY,Lotsi(),old_ask,0,Ask-StopLoss*Point,Ask+TakeProfit*Point,"Hit&Run",MagicNumber,0,Blue);
if (down_trend > 0.0) i = OrderSend(Symbol(),OP_SELL,Lotsi(),old_bid,0,Bid+StopLoss*Point,Bid-TakeProfit*Point,"Hit&Run",MagicNumber,0,Red);

for (cnt = 0; cnt < OrdersTotal(); cnt++)
   {
   OrderSelect(cnt,SELECT_BY_POS,MODE_TRADES);
   if ((OrderMagicNumber() == MagicNumber) && (OrderSymbol() == Symbol()))
      {
      if (OrderType() == OP_BUY)  i = OrderClose(OrderTicket(),OrderLots(),Bid,100,Blue);
      if (OrderType() == OP_SELL) i = OrderClose(OrderTicket(),OrderLots(),Ask,100,Red);
      }
   }
old_bid = curr_bid;
old_ask = curr_ask;

Comment("Hit and Run Scalper",
"\nACCOUNT INFORMATION","\nAccount Name: ",AccName,
"\nAccount Type: ",AccountText,
"\nAccount Number: ",AccNumber,
"\nLeverage: ",Leverage,":1",
"\nMimimum Lot Size: ",MinLots,
"\nMaximum Lot Size: ",MaxLots,
"\nLot Size: $ ",lotsize,
"\nLot Step: ",LotStep,
"\nOrder Lot Size: ",lotsi,
"\nOrder magic: ",MagicNumber,
"\nPROFIT/LOSS STATS",
"\nBalance: ",Balance,
"\nEquity: ",AccountEquity(),
"\nAccount Profit: ",AccountProfit(),
"\n",Symbol());
return(0);
}

double Lotsi()
{   
   Balance=AccountBalance(); 
   LotRisk=(risk*Leverage)/100;
   if (lotsize==100000)
   {
	   if (LotStep==1) { lotsi=MathFloor(Balance*LotRisk/100000); }
	   if (LotStep==0.1) { lotsi=MathFloor(Balance*LotRisk/10000)/10; }
	   if (LotStep==0.01) { lotsi=MathFloor(Balance*LotRisk/1000)/100; }
      AccountText="Standard";
   } else 
	  { 
	   if (LotStep==1) { lotsi=MathFloor(Balance*LotRisk/10000); }
	   if (LotStep==0.1) { lotsi=MathFloor(Balance*LotRisk/1000)/10; }
	   if (LotStep==0.01) { lotsi=MathFloor(Balance*LotRisk/100)/100; }
	   AccountText="Mini";
	  } 
   if (lotsi>MaxLots){ lotsi=MaxLots; }
   if (lotsi<MinLots){ lotsi=MinLots; }
return(lotsi);
}   

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 ---