RTD VBA - How do I to close a specific currency pair ?

keen2xl

New Member
Joined
Jun 9, 2013
Messages
5
I am just starting using RTD sending Order Commands from Excel to MT4 and I am stuck.

All I can find is how to Close ALL open trades, not my first choice.

VBA to Buy

------------------------------------

Sub EURUSD_Buy

Sheets("Trades").Select

If Range("O24") = "No Change" Then Exit Sub
If Range("P24") = "Sell" Then Exit Sub

Set cmd = CreateObject("FXBlueLabs.ExcelCommand")

strResult = cmd.SendCommand(Range("B1").Value, "BUY", "s=EURUSD.p|v=1000", 5)


End Sub

------------------------------------

Sub CloseAll()

Set cmd = CreateObject("FXBlueLabs.ExcelCommand")

strResult = cmd.SendCommand(Range("B1").Value, "CLOSEALL", "", 20

End Sub



I need the VBA String to simply close EURUSD only surely shouldn't be that hard you'd think, opening was easy enough.
I just can't find any code that does it anywhere.

Thanks
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,215,051
Messages
6,122,872
Members
449,097
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top