This thread will be an Open Source Project dedicated to trading Basket(s) off-line charts.
It was pulled from the Robot Lab Project as the basket was too big to fit in the lab.
The initial version will be a Manual Overdrive, which means that trading decisions are made by the trader not the robot.
So the robot will act only as a basket manager allowing to trade the basket off-line chart as close as possible to a normal on-line chart.
Next versions will provide Fully Automatic options, so that the Robot will trade/exit according to built-in strategies.
Copying Files:
- Copy Create_Basket_Script_xx.ex4 into ...\MQL4\Scripts\ folder. Latest Version Here
- Copy Basket_Manager_xx.ex4 into ...\MQL4\Experts\ folder. Latest Version Here
M1 Historical Data:
- Make sure that you have “enough” M1 history data for each pair that will be used in the each basket you create
- M1 history data can be refreshed by opening each pair on M1 time frame, zoom out to the maximum, scroll back as much as MT4 allows you to, and Refresh the chart by pressing Mouse Right Click and selecting Refresh from the pop up menu.
Creating the Basket
- Place Create_Bastet_Script_xx on a chart of your choice on M1 time frame
- Input the required information and Press OK:
- Basket Name : This is a user defined name for the basket.
- Maximum 12 characters
- Examples: USDBSKT,#USD#,XYZ01,#A1#,ENRGY,HITECH etc
- Time Frame Name: The time frame to be used to create the Offline Chart for the Basket (i.e. M15, H1, H4 etc)
- Basket Pairs: Here you define the Basket Component Pairs. Use Exact Pair Name as it appears in Market Watch. Pairs should be separated by comma
- Pairs Directional Weight :
- Direction should be Positive if you want the basket price to go up when the pair price goes up, and Negative if you want the basket price to go down when the pair price goes down, and vice versa
- Weight : You can simply use 1 (to be discussed later)
- Basket Name : This is a user defined name for the basket.
- The script will show an alert with the created basket name/time frame
- Go to File>Open Offline> and select the basket chart that was created
Running the Robot
- Place the robot Basket_Manager_xx.ex4 on the opened offline basket chart
- Enjoy Your Shopping !
The Basket Manager Provides:
- Market Orders
- Buy Orders (3)
- Sell Orders (3)
- Pending Orders
- Buy Stop Orders (2)
- Sell Stop Orders (2)
- Buy Limit Orders (2)
- Sell Limit Orders (2)
- All orders offer Draggable SL and TP Lines
- You can make trade decisions using your favorite strategy/indicator(s) on the off-line chart
- You can trade multiple basket charts on the same account. Just make sure you give different Magic Number for each Robot Instance.
- The robot adds 2 digits to the input magic number in order to differentiate between different basket orders . For example if you set the magic number to 999, the first buy basket orders will have an internal magic number of 99901, the first sell basket order internal magic number will be 99911, and so on. So use magic number of 3 to 5 digits in order to allow space for the additional 2 digits added by the robot.
- Once market order is created, its button will show the current P/L for the underlying set of actual orders. You can close it by pressing on the button showing the P/L.
- Current P/L of all market orders will show on the Green Button. You can close all the orders by pressing this button.
- Once a Pending Order is triggered, it will be converted to a Market Order (provided there is space for it).
- .... to be continued
Basket Tools (updated) :
- Basket Creation Scripts :
- Version 2 (template option). Post # 88.
- Version 3 (multiplication instead of summation) Post # 160.
- Basket Manager EAs:
- Version 2 (FINAL) Post # 84.
- Version 3 (FINAL) Post # 309.
A screen shot
Regards,
Khalil Abokwaik
Attached File(s)
Create_Basket_Script_01.mq4
13 KB
|
2,235 downloads
Create_Basket_Script_01.ex4
19 KB
|
1,570 downloads
Basket_Manager_02.ex4
161 KB
|
1,613 downloads
Basket_Manager_02.mq4
68 KB
|
2,166 downloads
No guts, no glory