Download MetaTrader 5

Scripts: ProfitOnDrop

To add comments, please log in or register
MetaQuotes Software Corp.
Moderator
188172
MetaQuotes Software Corp.  

ProfitOnDrop:

Calculates the profit from oppened trades if the Price reaches the dropped Price

Author: Matus German

Pankaj Bhaban
2048
Pankaj Bhaban  
Can you instead make it like indicator line which can be dragged over chart can would calculate the final profit/loss from all open trades.
Pankaj Bhaban
2048
Pankaj Bhaban  
Nice work, instead could make an indicator line which can be dragged on chart to see profits at various levels/prices.
Bambang Sugianto
10522
Bambang Sugianto  
         if(OrderType()==OP_BUY)
            profit+=(targetPrice-OrderOpenPrice())/point*MarketInfo(Symbol(),MODE_TICKVALUE)*OrderLots()+OrderSwap();
         if(OrderType()==OP_SELL) 
            profit+=(OrderOpenPrice()-targetPrice)/point*MarketInfo(Symbol(),MODE_TICKVALUE)*OrderLots()+OrderSwap();

will be more proper. 
To add comments, please log in or register