Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Increase Position Size After Loss

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Increase Position Size After Loss

    I can't figure this out. I've uploaded the strategy. I need it to Increase Position Size after each Loss. You'll find my attempt in the section

    Code:
    //MANAGE LOSSES
    	#region LOSSES MAnagement
    			//STEP 1: Reset the trade Counter at Beginning of NEW Session
    				if (Bars.FirstBarOfSession && FirstTickOfBar)
    				{
    					previousLossTrade = 0;
    					priorSessionTrades = Performance.AllTrades.Count;
    				}
    			//STEP 2: Here, Performance.AllTrades.Count - priorSessionTrades checks to make sure there have been 1 trades today.
    					//   priorNumberOfTrades makes sure this code block only executes when a new trade has finished.
    			if ( FirstTickOfBar && (Performance.AllTrades.Count - priorSessionTrades) >= 1 && Performance.AllTrades.Count != priorNumberOfTrades)
    			{
    				// Reset the counter.
    				previousLossTrade = 0;
    					
    				// Set the new number of completed trades.
    				priorNumberOfTrades = Performance.AllTrades.Count;
    			
    				//Look at Last Trade (index 1) Performance
    				Trade lastTrade = Performance.AllTrades[Performance.AllTrades.Count - 1];
    				lastProfit = lastTrade.ProfitPoints;
    				//If the trade's profit is greater than Set Target, RESET COUNTER. IF Less than Loss Target, Add one.
    					if (lastTrade.ProfitPoints >= 2)
    						previousLossTrade = 0;
    					else if (lastTrade.ProfitPoints <= -1.8)
    						previousLossTrade++; 
    						
    					Print("The last trade's profitLoss is " + lastProfit);
    					Print("Last Trade Won/Loss: " + previousLossTrade);
    			}
    			
    		//REGULAR Position Size: If Previous Trade Didn't Lose, Go for Regular Profit Target and Position Size
    						if(previousLossTrade == 0)
    							{
    								tradeLotSize = scalpLotSize;
    								takeProfit = profitTarget;		
    							}	
    					//RECOVERY TRADE Size:: If Only One Previous LOSS occurred, Increase Size and Target to Recover
    						else if(previousLossTrade == 1)
    							{
    								tradeLotSize = scalpLotSize * 3;
    								takeProfit = recoveryTarget;		
    							}	
    					//2nd RECOVERY TRADE Size:: If Two Previous LOSSes occurred, Increase Size and Target to Recover
    						else if(previousLossTrade == 2)
    							{
    								tradeLotSize = scalpLotSize * 6;
    								takeProfit = recoveryTarget;		
    							}
    			//PRINT Current Position Size after High Volume APpears. So you always know what the Next Trade size will be in OutPut Window
    					if(Volume[0] >= Volume[1])
    					{	Print("NEXT POSITION SIZE " + tradeLotSize);	}			
    				
    	#endregion
    What's actually happening is that the Position Size stays the Same after each Loss. I don't know why.

    Please Help.

    Thank You
    Attached Files

    #2
    Hello,

    I believe this may be due to the logic you are using. I tested the script on the ES 12-15 on a 1 minute chart and see the prints:

    NEXT POSITION SIZE 1000
    and
    NEXT POSITION SIZE 3000

    If the variable in question is the one you are printing or tradeLotSize, I do see this being updated and changed.

    Can you confirm, is this the correct variable in question and are you not seeing it increment? if not can you provide more specific details on exactly which values do not increment?

    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    558 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    545 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X