Using Price Levels to quit the strategy

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #82528 quote
    simeong
    Participant
    Average

    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 ?

    close[0]> 11500 then
    quit
    endif
    
    #82531 quote
    robertogozzi
    Moderator
    Master

    Yes, but don’t forget:

    1) IF at the beginning of line 1

    2) . to make price 1.1500

    simeong thanked this post
    #82636 quote
    simeong
    Participant
    Average
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    ignored, indicator2, indicator1 = CALL averages
    
    IF indicator1 crosses under  indicator2 THEN
    buy 2 PERPOINT AT MARKET
    ENDIF
    
    if indicator1 crosses over indicator2 and positionperf(0)>2 then
    EXITSHORT at market
    endif
    
    if close[0]>11258 then
    quit
    endif
    
    
    SET TARGET PROFIT 7
    SET STOP LOSS 3
    
    

    So 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.

    #82641 quote
    Nicolas
    Keymaster
    Master

    Because while the history is loaded, this condition is met. Try to not load any data when the program start with:

    defparam preloadbars=0

    But 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.

    simeong thanked this post
    #82681 quote
    simeong
    Participant
    Average

    Hi 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.

    #82682 quote
    simeong
    Participant
    Average

    Is they any other way that you can set price levels on PRT ?

    #82683 quote
    GraHal
    Participant
    Master

    What TF are you testing on?

    I’ll try it out tomorrow, maybe even now! 🙂

    Also please provide your Indicator … Averages

    simeong thanked this post
    #82704 quote
    simeong
    Participant
    Average

    Hi 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,

    #82705 quote
    simeong
    Participant
    Average

    Hi Grahal,

     

    I am using the 10 minute timeframe.

    #82706 quote
    GraHal
    Participant
    Master

    To 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?).

    #82711 quote
    simeong
    Participant
    Average

    Hi Grahal,

     

    I have actually located the issue and fixed it but thanks for your help.

    #82713 quote
    simeong
    Participant
    Average

    Hi 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 ?

    #82714 quote
    GraHal
    Participant
    Master

    I 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?

    #82779 quote
    Nicolas
    Keymaster
    Master

    ProOrder 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.

    simeong thanked this post
    #82918 quote
    simeong
    Participant
    Average

    Hi 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,

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.

Using Price Levels to quit the strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
simeong @simeong Participant
Summary

This topic contains 15 replies,
has 4 voices, and was last updated by GraHal
7 years, 4 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 10/10/2018
Status: Active
Attachments: No files
Logo Logo
Loading...