Opening position after 'event'. But no more then once, until next 'event'.
Forums › ProRealTime English forum › ProOrder support › Opening position after 'event'. But no more then once, until next 'event'.
- This topic has 3 replies, 3 voices, and was last updated 8 years ago by Adolfo.
-
-
04/22/2016 at 12:59 PM #5814
Hi fellow ProRealCode users,
I have been testing and trying stuff for the past month, but cant seem to get the code right for a specific action.
I want to open a position when the indicators cross over. , but I don’t want to open a extra position after that. (when first position is closed with profit) I only want to open again after the indicators crossed over again.
Something like this in normal words;
123456789// Conditions to enter long positionsindicator1 = ExponentialAverage[5](close)indicator2 = ExponentialAverage[20](close)c1 = (indicator1 > indicator2[1])c2 = (indicator1 < indicator2[1])IF c1 THENBUY 1 CONTRACT AT MARKETENDIFIF c1 but c2 hasent happend yet, don’t BUY 1 CONTRACT AT MARKET. (<– What I mean is ; after the c1 happened, and a contract is bought , only buy another one , when c2 happened. In the backtest it opens the trade correctly , and closes with a pPROFIT. But the next candle it opens again , because c1 is still valid. I want c2 to happen first , and then if c1 happens open another trade.)Hopefully someone has an idea how to set this up… Its a guaranteed moneymaking machine… 😉 ;p
04/22/2016 at 4:29 PM #5831Hi AutoTrader,
Basically, what you want to do here is to test a crossover between 2 values, like moving average.
ProRealTime has instructions built in to test these conditions, they are called : CROSSES OVER and CROSSES UNDER
So your c1 and c2 conditions would be:
12c1 = indicator1 crosses over indicator2c2 = indicator1 crosses under indicator2I believe that would make it, am I right?
04/23/2016 at 1:29 PM #5845Hi Nicolas,
That is correct! Thank you! Made a very simple system that scores 100% on the 5min Dax cash. (backtest) Will live test it next week Monday until Friday.
Thanks for pointing out the crossover!
04/23/2016 at 5:55 PM #5864 -
AuthorPosts
Find exclusive trading pro-tools on