profit reduces by 33%

Viewing 10 posts - 31 through 40 (of 40 total)
  • Author
    Posts
  • #69676 quote
    robertogozzi
    Moderator
    Master

    It seems to be working….. almost correctly!

    Yes, you have the same reference to 30 in both lines 9  and 13, so should X be equal to 30 both IFs will be executed thus making line 10 superfluous. I suggest that you either replace 30 in line 9 with 29 OR 30 in line 13 with 31.

    #69747 quote
    rama
    Participant
    Senior

    Code works well for

    defparam cumulateorders = false

     

    if I want run the same code

     

    defparam cumulateorders = TRUE

     

    what changed I need to make to single order code to make it multiple orders, I am running this on IG UK spread betting account

    #69750 quote
    robertogozzi
    Moderator
    Master

    I never used more than one order per strategy.

    What I know for sure is that there is ONE single SL and TP for each strategy, so if you accumalate contracts you have to set them only once. Also, no partial closing is allowed as of the current version of ProOrder, so all contracts need to be sold at one time, no matter whether you bought them at different times.

    I cannot tell you more about this, but according to what I said above, I think you don’t have to change anything since you have ONE trailing stop.

    #69973 quote
    rama
    Participant
    Senior

    PRT really worrying

    it worked on demo on live placed plenty of unwanted orders

    Set stop loss 36
    ret=.5
    ret1=.75
    ret2=.8
    IF Not OnMarket THEN
    y = 0
    ENDIF
    IF LongOnMarket AND close > (TradePrice + (y * pipsize)) THEN
    x = (close - tradeprice) / pipsize //convert price to pips
    IF x >= 15 and x<=20  THEN //go ahead only if 30+ pips
    y = max(x * ret, y) //y = 66.6% of max profit
    ENDIF
    
    IF x >= 20.1 and x<=100  THEN //go ahead only if 30+ pips
    y = max(x * ret1, y) //y = 66.6% of max profit
    ENDIF
    
    IF x >= 101 and x<=200  THEN //go ahead only if 30+ pips
    y = max(x * ret2, y) //y = 66.6% of max profit
    ENDIF
    
    
    ENDIF
    IF y THEN //Place pending LIMIT (not STOP) order when y>0
    SELL AT Tradeprice + (y * pipsize) stop //convert pips to price
    ENDIF
    
    
    stoporders.jpg stoporders.jpg
    #69977 quote
    robertogozzi
    Moderator
    Master

    If you post the whole strategy I’ll take a look at it.

    #70091 quote
    rama
    Participant
    Senior

    I ran the following code. I expect the system should stop out either 99 GBP loss or 90 GBP minimum profit or more

    results attached ( why the system stopped out 49.8 gbp loss)

    //-------------------------------------------------------------------------
    // Main code : 3secsell(2)
    //-------------------------------------------------------------------------
    defparam cumulateorders = false
    DEFPARAM Preloadbars = 2000
    DEFPARAM flatafter  = 205900
    //startBreakeven = y//how much pips/points in gain to activate the breakeven function?
    //PointsToKeep = x//how much pips/points to keep in profit above of below our entry price when the breakeven is activated (beware of spread)
    
    ctime1 = time > 161500 and time < 162500
    
    x=2
    IF not onmarket and  ctime1 THEN
    sellshort .5 perpoint at market
    ENDIF
    Set stop loss 99
    
    ret=.1
    
    
    IF Not OnMarket THEN
    y = 0
    ENDIF
    IF shortonMarket AND close < (TradePrice - (y * pipsize)) THEN
    x = (tradeprice-close) / pipsize //convert price to pips
    IF x >=98 then//go ahead only if 30+ pips
    y = max(x * ret, y) //y = 66.6% of max profit
    ENDIF
    
    
    ENDIF
    IF y THEN //Place pending LIMIT (not STOP) order when y>0
    exitshort  AT Tradeprice - (y * pipsize) stop //convert pips to price
    ENDIF
    Set stop loss 99
    
    49.8.jpg 49.8.jpg
    #70093 quote
    GraHal
    Participant
    Master

    DEFPARAM flatafter  = 205900

    What time was the system stopped out 49.8 gbp loss??

    #70095 quote
    rama
    Participant
    Senior

    screenshot attached

    49.8-1.jpg 49.8-1.jpg
    #70098 quote
    rama
    Participant
    Senior

    system worked correctly, i was betting .5 per point so .5*99=49.5 system booked 49.8 as expected

    #70099 quote
    GraHal
    Participant
    Master

    Yeah I ran your System and used GRAPH and came to the same conclusion about 20 seconds ago! 🙂 Pat on the back for both of us!!! Well done rama! 🙂

Viewing 10 posts - 31 through 40 (of 40 total)
  • You must be logged in to reply to this topic.

profit reduces by 33%


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
rama @rama Participant
Summary

This topic contains 39 replies,
has 6 voices, and was last updated by GraHal
7 years, 10 months ago.

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