Results 1 to 5 of 5
 0 Attachment(s)    

Thread: Stealth TrailingStop

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    13

    Default Stealth TrailingStop

    Im looking for some code that I can place into an existing EA that will provide a stealth Trailing stop... what I need is something that does not change the take profit or stoploss that the EA places but I want it to start at a definded position... such as 10 pips profit... and the trailing stop will run something like 2 pips trailing. The code needs to be stealth since my broker has a 10 pip spread for TP and SL. Does anyone have this or can one be made?

    I appreciate you help!

  2. #2
    Junior Member
    Join Date
    Aug 2009
    Posts
    13

    Default

    well since no one helped with this... here is some code... may not be TRailing stop but could easily be made into one!

    extern bool use_hidden_stop_loss = true;
    extern int hidden_sl = 100;
    extern bool use_hidden_take_profit = true;
    extern int hidden_tp = 100;



    void hidden_take_profit()
    {
    int totalorders = OrdersTotal();
    for(int i=totalorders-1;i>=0;i--)
    {
    OrderSelect(i, SELECT_BY_POS);
    bool result = false;
    if ( OrderSymbol()==Symbol() )
    {
    if (OrderType() == OP_BUY && OrderOpenPrice()+hidden_tp*Point<=Bid ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
    if (OrderType() == OP_SELL && OrderOpenPrice()-hidden_tp*Point>=Ask ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );

    }
    }
    return;
    }



    void hidden_stop_loss()
    {
    int totalorders = OrdersTotal();
    for(int i=totalorders-1;i>=0;i--)
    {
    OrderSelect(i, SELECT_BY_POS);
    bool result = false;
    if ( OrderSymbol()==Symbol() )
    {
    if (OrderType() == OP_BUY && OrderOpenPrice()-hidden_sl*Point>=Bid ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID), 5, Red );
    if (OrderType() == OP_SELL && OrderOpenPrice()+hidden_sl*Point<=Ask ) result = OrderClose( OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK), 5, Red );

    }
    }
    return;
    }




    int start()
    {
    //----
    if (use_hidden_stop_loss) hidden_stop_loss();
    if (use_hidden_take_profit) hidden_take_profit();
    //----
    return(0);
    }


    Well... I guess i should thank myself...

  3. #3
    Junior Member
    Join Date
    Sep 2009
    Posts
    1

    Default

    And I say tank you

  4. #4
    Junior Member
    Join Date
    Jan 2009
    Posts
    2

    Default

    PLEASE _______http://www.kimiv.ru/index.php?option=com_remository&Itemid=13&func=fil einfo&id=73

  5. #5
    Junior Member
    Join Date
    Jan 2009
    Posts
    18

    Default

    thanks for this

Similar Threads

  1. Stealth Forex V10
    By zoop in forum Ideas for expert advisors
    Replies: 10
    Last Post: 06-18-2012, 18:48
  2. Stealth Forex Expert Advisor
    By funyoo in forum Commercial expert advisors
    Replies: 9
    Last Post: 06-18-2012, 18:46
  3. Stealth v10 system EA
    By 4x4me in forum Ideas for expert advisors
    Replies: 0
    Last Post: 07-27-2010, 20:24
  4. Trailingstop ea
    By forexnoobs in forum MQL programming
    Replies: 0
    Last Post: 05-09-2009, 05:50

Tags for this Thread

100, broker, change, index, pips, profit, spread, stop, stoploss, trailing, trailingstop

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •