Using Price Levels to quit the strategy
Forums › ProRealTime English forum › ProOrder support › Using Price Levels to quit the strategy
- This topic has 15 replies, 4 voices, and was last updated 6 years ago by GraHal.
Tagged: quit
-
-
10/10/2018 at 11:26 PM #82528
Hi,
I did look over the rules for posting but unfortunately I forgot my laptop at the office so wont be able to post code etc. However I was looking for some help on the following issue;
I am building a system that I want to QUIT once it reaches a certain price level for example on the EUR/USD at 11500
So I guess my question is how do I input the price level into the code.
Would the code below be correct ?
123close[0]> 11500 thenquitendif10/11/2018 at 2:13 AM #82531Yes, but don’t forget:
1) IF at the beginning of line 1
2) . to make price 1.1500
1 user thanked author for this post.
10/12/2018 at 12:20 PM #82636System does not ever start running123456789101112131415161718DEFPARAM CumulateOrders = False // Cumulating positions deactivatedignored, indicator2, indicator1 = CALL averagesIF indicator1 crosses under indicator2 THENbuy 2 PERPOINT AT MARKETENDIFif indicator1 crosses over indicator2 and positionperf(0)>2 thenEXITSHORT at marketendifif close[0]>11258 thenquitendifSET TARGET PROFIT 7SET STOP LOSS 3So when I add the price level to my code the system stops running. I am using the system on the USDJPY. I have tried entering the price level as 11258 and 112.58 but on both occasion the system does not run. As soon as I take out the code with the price constraints the system runs fine.
10/12/2018 at 12:47 PM #82641Because while the history is loaded, this condition is met. Try to not load any data when the program start with:
1defparam preloadbars=0But it might affect your indicators calculations, I don’t know what are their calculation periods and the timeframe you are using with this trading strategy.
1 user thanked author for this post.
10/12/2018 at 9:04 PM #82681Hi Nicolas,
I did incorporate the Deparam method and the indicators certainly work when preloadedbars=0. However when I put in certain price levels the system does not run(the system only runs when I put the price level at ridiculously high levels). Which is odd as they are no preloaded bars and the current close[0] on the USDJPY for the backtest is not near the 11258 price level
Thanks again for your helpful input.
10/12/2018 at 9:09 PM #8268210/12/2018 at 9:55 PM #8268310/13/2018 at 4:31 PM #82704Hi Grahal,
Thanks for your input.
I am using very short averages(two days) and ROC indicator again short periods.
I am sure to enter appropriate pre-loaded bars before running the machine so indicators get relevant data.
Look forward to hearing from you.
Kind Regards,
10/13/2018 at 4:37 PM #8270510/13/2018 at 4:44 PM #82706To make it easy for me to help you I need code I can paste into my Platform and then start fault finding when / if it doesn’t run.
I am using very short averages(two days) and ROC indicator again short periods.
I’m doing other stuff and not got time to try this and that and if I did I may not replicate your code so my time could be wasted?
So can you post on here the .itf file as this will contain you Indicator Averages (I think?).
10/13/2018 at 5:49 PM #8271110/13/2018 at 6:07 PM #82713Hi Grahal,
I did solve the previous issue is seems I was missing a digit from my price level. However I do have a question that I was hoping you might be able to help me on. Of course given the system the price level will change so is it possible to make the price level a variable so you can alter the level from outside of the code and you don’t have to always have the price-level hard=coded into the machine/system ?
I have tried to use variable optimisation as you would when creating an indicator but have had no luck ?
10/13/2018 at 6:54 PM #82714I was missing a digit from my price level
Glad you told us, it’s good to close the loop …. thanks.
I don’t fully understand what you are trying to achieve (the code would help) but in any case I’m not good at coding, but plenty on here are very very good!
Could you not use several Price levels hard coded into the strategy combined with a % distance from etc?
10/15/2018 at 11:42 AM #82779ProOrder only use compiled code, so you can’t change the variables set into the code once the program has been pushed into live trading. There is also no external settings available to change value while the program is running.
1 user thanked author for this post.
10/16/2018 at 6:08 PM #82918Hi Nicolas,
Thanks for the confirmation. One other thing that I wanted to confirm was when your about to run an auto system you are forced to enter a maximum position/stake size.
Now my system is running a 1.5 stake size(Spread Betting) per pip. Is it possible to have a stake size that is a decimal or do you have to choose a whole number ? For example could you have a stake size of and put a max bet in of 2.
Kind Regards,
-
AuthorPosts
Find exclusive trading pro-tools on