determine if a trade is currently profitable (while still open)

 

How do I determine if a trade is currently profitable (while still open)? It seems like I should be using MarketOrder and OrderOpenPrice.

 
MisterDog:

How do I determine if a trade is currently profitable (while still open)? It seems like I should be using MarketOrder and OrderOpenPrice.

Select the order using OrderSelect(), then:


profit = OrderProfit() + OrderSwap() + OrderCommission();

 
Thanks! The markets are closed right now so I tried these commands on back testing. OrderSwap() and OrderCommission() both show a zero value but I bet that will change once I'm running on the real market.
 
MisterDog:
Thanks! The markets are closed right now so I tried these commands on back testing. OrderSwap() and OrderCommission() both show a zero value but I bet that will change once I'm running on the real market.
Correct. They will always be zero when running the tester. Swap is only added when the daily roll-over occurs on a live account (you also have no swap on a demo account, at least with the broker I use). Google for what forex swap is and check your brokers website as the calculations and interest charged varies from broker to broker. OrderCommission() should generally be zero for forex unless you are maybe trading on an Islamic account that does not charge usury (interest). Commisions are usually charged for CFD's or Stocks.
 
Plenty of Brokers charge Commission on Forex . . . it's how they are able to offer small spreads . . .
 
RaptorUK:
Plenty of Brokers charge Commission on Forex . . . it's how they are able to offer small spreads . . .
Define a "small spread"? < 10 points? < 20 points on a 5 digit broker?
 
rocketman99:
Define a "small spread"? < 10 points? < 20 points on a 5 digit broker?

No strict definition, you just can tell. ECN broker (market order) usually offer smaller spread compare to conventional broker (instant order), but not always, some ECN broker offer same spread as conventional broker. ECN usually also charge commission.

:D