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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,039
Latest member
Mbone Mathonsi

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