toptrader:
First explain what you want and what you get, maybe then it will possible to help.
I have written the following code to test a simple strategy. However, the trades shown are nowhere near what I want. Can anyone tell me what I'm doing wrong?
It's pretty simple. When the low is above ma2, I want to enter a buy stop at a price of hh. When the high is below ma2, I want to enter a sell stop at a price of ll. I then want to use ma1 as a trailing stop for any open positions. When I test the strategy, I am getting tons of sell orders, but not at the proper time/price.
Ok,
First you need to check whether order is already at the place, when you try to open:
if ( longticket <= 0 ) { OrderSend(); } if ( shortticket <= 0 ) { OrderSend(); }
This will reduce the number of pendings, I believe=)
Next, you need to check if levels that you want to use are ok to use, I mean check the Stop Level distance.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have written the following code to test a simple strategy. However, the trades shown are nowhere near what I want. Can anyone tell me what I'm doing wrong?