• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 12:12am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 12:12am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Can you trade only one pattern and be profitable? 57 replies

How many years should I test My system, to consider it, profitable? 18 replies

profitable semaphor EA and indicator for you to test 4 replies

Why EA test is forward test better than back test?? 1 reply

Close Pending Orders When last order was profitable 35 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe

How can i test if the last trade was profitable

  • Post #1
  • Quote
  • First Post: May 25, 2010 8:42am May 25, 2010 8:42am
  •  censura
  • | Joined Sep 2006 | Status: Member | 405 Posts
Hi i want to test and retrieve the result of the last trade ie was it profitable or lossing trade and return value 1 profitable -1 lossing trade

does anyone know ho to do this kind regards
  • Post #2
  • Quote
  • Last Post: May 25, 2010 10:42am May 25, 2010 10:42am
  •  Kenz987
  • Joined Aug 2006 | Status: Member | 737 Posts
int OrdersHistoryTotal( )
Returns the number of closed orders in the account history loaded into the terminal. The history list size depends on the current settings of the "Account history" tab of the terminal.
Sample:
// retrieving info from trade history
int i,hstTotal=OrdersHistoryTotal();
for(i=0;i<hstTotal;i++)
{
//---- check selection result
if(OrderSelect(i,SELECT_BY_POS,MODE_HISTORY)==false)
{
Print("Access to history failed with error (",GetLastError(),")");
break;
}
// some work with order
}
The most recent closed is probably index 0, but not sure, from there use other order key words open price and close price etc to compute the p/l.
  • Platform Tech
  • /
  • How can i test if the last trade was profitable
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021