Author:
Orders Execution
It automatically opens orders when conditions are reached
Miscellaneous
It issuies visual alerts to the screen
0 Views
0 Downloads
0 Favorites

Profitability Reports

GBP/CAD 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%
_Open_SELL
//+------------------------------------------------------------------+
//|                                                   _Open_SELL.mq4 |
//|                                           "ÑÊÐÈÏÒÛ ÄËß ËÅÍÈÂÎÃÎ" |
//|             Ñêðèïò îòêðûâàåò SELL íà çàäàâàåìóþ ÷àñòü FreeMargin |
//|                           Bookkeeper, 2006, yuzefovich@gmail.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""
#property show_inputs // Åñëè åñòü æåëàíèå ìåíÿòü ýêñòåðíû â ïðîöåññå
//+------------------------------------------------------------------+
extern double Share      = 0.1;  // Âûäåëèòü ÷àñòü FreeMargin íà ïîçó:
                                 // = 0 îòêðûòü ìèíèìàëüíûì ëîòîì
                                 // = 1 îòêðûòü ñî âñåé äóðè
extern int    DistSL     = 35;   // Ðàññòîÿíèå äî SL
extern int    DistTP     = 35;   // Ðàññòîÿíèå äî TP
extern int    Slippage   = 5;    // Ïðîñêàëüçûâàíèå
extern bool   StopLoss   = true; // Ñòàâèòü èëè íåò
extern bool   TakeProfit = true; // Ñòàâèòü èëè íåò
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void start() 
  {
    int    ticket;
    double SL = 0, TP = 0, Stake, StepDgts;
    double Step = MarketInfo(Symbol(), MODE_MINLOT);   
    int    Dgts = MarketInfo(Symbol(), MODE_DIGITS);     
//----
    if(AccountFreeMargin() < Step*1000*Ask)
      {
        Alert("Open_SELL: No maney...");
        return;
      }
//----
    if(Share > 1.0) 
        Share = 1.0;  // ×àñòü íå áûâàåò áîëüøå öåëîãî
//----
    if(Share < 0) 
        Share = 0;   
//----
    if(Step < 0.1) 
        StepDgts = 2;
    else
      {
        if(Step < 1.0) 
            StepDgts = 1;
        else 
            StepDgts = 0;
      }
//----
    Stake = NormalizeDouble(AccountFreeMargin()*Share / 1000 / Ask, StepDgts);
    if(AccountFreeMargin() < Stake*1000*Bid)       // Îêðóãëåíèå áûâàåò è ââåðõ
        Stake = NormalizeDouble(Stake - Step, StepDgts); // Òåïåðü ëèøêó íå áóäåò  
    //Åñëè âûäåëåííàÿ ÷àñòü äåïî áóäåò ìåíüøå ìèíèìàëüíî äîïóñòèìîãî ëîòà,
    //ïîçà áóäåò îòêðûòà íà ìèíèìàëüíûé ëîò
    if(Stake < Step) 
        Stake = Step;
    if(StopLoss == true) 
        SL = Ask + DistSL*Point;
    if(TakeProfit == true) 
        TP = Bid - 2*DistTP*Point;
    ticket = OrderSend(Symbol(), OP_SELL, Stake, Bid, Slippage, NormalizeDouble(SL,Dgts),
                       NormalizeDouble(TP,Dgts), "", 0, 0, CLR_NONE);
    if(ticket <= 0) 
        Alert("Error Open_SELL: ", GetLastError()); 
    return(0);
  }
//+------------------------------------------------------------------+

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