Good morning new here but not to trading, I am trying to use a simple code to grab positions when RSI dips below for a long position. Then bank when reverses making x many points. The backtest works but the live scenario doesnt place any orders when running and wondering if I am missing anything obvious here is the code not much too it as testing only to get it working first. Any help would be grateful thank you.
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = RSI[10](close)
c1 = (indicator1 CROSSES UNDER 38)
IF c1 THEN
BUY 2 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET TARGET pPROFIT 50
Always use the ‘Insert PRT Code’ button when putting code in your posts to make it easier for others to read.
Thank you 🙂
You also posted inthe wrong support forum, it’s ProOrder for strategies, as you can read from the highlighted rules below (in yellow). I moved it to the correct place.
I tested on a 5-minute TF with 200K units anditworks.
What TF and how many unists are you using?
Because there could be no valid entry conditions with a few units.
Thanks again, Ah I didnt think about units my view was 1hr and left at 100 units which makes sense it couldn’t get a trade ill amend and see if that works thank you. Does the chart need to be open on the screen to work?
Yes, while backtesting.
No,when the strategy runs in AutoTrading.
Yes, while backtesting.
No,when the strategy runs in AutoTrading.
Perfect amended with 1gr 1k unit to test it. Ill see if it works if moves down today.
//-------------------------------------------------------------------------
// Main code : short test
//-------------------------------------------------------------------------
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter short positions
indicator1 = RSI[10](close)
c1 = (indicator1 >= 70)
IF c1 THEN
SELLSHORT 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET TARGET pPROFIT 15
I just tried a short as it was going the other way still didnt work :/. I just done a manual sell and that worked from prorealtime so the link is working. RSI crossed over 71 so well over the 70.
Ignore that it just worked maybe I need to up the units even further. Trial and error least one worked so getting there.
So that short worked, I set up a 10 minute long and that didnt work again? What am I doing wrong :/
//-------------------------------------------------------------------------
// Main code : small RSI 10m 39
//-------------------------------------------------------------------------
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = RSI[10](close)
c1 = (indicator1 CROSSES UNDER 39)
IF c1 THEN
BUY 1 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET TARGET pPROFIT 10
I just opened the chart and it triggered so do I need the chart open perhaps?
What instrument,TF and units are you using?
Hi,
Im using FTSE, 1hr 1000units. I have just redone it all from scratch and will leave on my home pc and see if it triggers. RSI =< 37 and then another order RSI =< 28 . Its quite simple just more for when I am unable to open a trade it will catch the move for me is my thinking.
//-------------------------------------------------------------------------
// Main code : RSI under 38
//-------------------------------------------------------------------------
// Definition of code parameters
DEFPARAM CumulateOrders = False // Cumulating positions deactivated
// Conditions to enter long positions
indicator1 = RSI[10](close)
c1 = (indicator1 <= 38)
IF c1 THEN
BUY 2 PERPOINT AT MARKET
ENDIF
// Stops and targets
SET TARGET pPROFIT 45
This didn’t work, left running overnight and went sub 38 this am and hasn’t triggered frustrating. I have change the =< to crosses under but I dont see what difference that should make.
From trying a few things it seems a little random if they work or not any help is appreciated, I feel im missing something obvious.
It’s due to very strict conditions. On my test on FTSE, 1h, 200K bars (10 and a half years), it only took 66 trades, that is 6 trades/year, which is 1 trade every other month!
You have to keep it running at least one year to see some trades opened, not just overnight!