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
Hi all,
Can someone help me with the below please?
I have developed this piece of code, which aims to open a position following a sharp variation in price in a given time-span.
If the price rises by at least 550 points in 2 candles, then the robot opens a SELL position.
If the price drops by at last 550 points in 2 candles, then the robot opens a BUY position.
Furthermore, the code is written to open a position only outside of the candles, and only if there are no other positions open.
I have 2 problems with this code.
1. The first and major problem is that the robot doesn't always capture the price variation. Meaning, that even it the price has moved by the minimum threshold, the robot doesn't open a position. It is visible even when backtesting. I recommend checking with gold or Brent. Both are suitable for the inputs already in the code.
2. The second problem is that the code works only with a minimum of 2 candles. If CloseB is set to be 1 candle behind rather than 2, the robot makes 0 trades.
CODE
Many thanks for your help!
BestDavide