Is the floating profit/loss (FPL) accurate?

Goblintrader21

New member
I've been backtesting strategies on futures and am curious how accurate this number is? Obviously, I know in live trading this number won't be realistic but does it at least give an accurate estimate? It also seems like the further back the timeline, the less the return makes sense. Does FPL not work over a long period of time? Appreciate any insight. Cheers.

Here's my code for buy orders in case anyone was curious.

Code:
# Bullish Orders
AddOrder(OrderType.BUY_TO_OPEN, condition = BuyTrigger,
price = close, 1, tickcolor = Color.GREEN, arrowcolor =
Color.GREEN, name = "BUY");
AddOrder(OrderType.SELL_TO_CLOSE, condition = SellTrigger,
price = open, 1, tickcolor = Color.RED, arrowcolor = Color.RED,
name = "SELL");
# Bearish Orders
AddOrder(OrderType.SELL_TO_OPEN, condition = SellTrigger,
price = open, 1, tickcolor = Color.RED, arrowcolor = Color.RED,
name = "SELL");
AddOrder(OrderType.BUY_TO_CLOSE, condition = BuyTrigger,
price = close, 1, tickcolor = Color.GREEN, arrowcolor =
Color.GREEN, name = "BUY");
 
Solution
I've been backtesting strategies on futures and am curious how accurate this number is? Obviously, I know in live trading this number won't be realistic but does it at least give an accurate estimate? It also seems like the further back the timeline, the less the return makes sense. Does FPL not work over a long period of time? Appreciate any insight. Cheers.


Sometimes accurate not real life. You didn't provide the buy / sell conditions or time frames so it isn't possible to provide more of an answer.
You need to fix your price= statement:
If you're testing the strategies in thinkscripts, the most accurate P&L is when the AddOrder entry time is set as "open[-1]". Meaning that it will mark the price of the open of the...
I've been backtesting strategies on futures and am curious how accurate this number is? Obviously, I know in live trading this number won't be realistic but does it at least give an accurate estimate? It also seems like the further back the timeline, the less the return makes sense. Does FPL not work over a long period of time? Appreciate any insight. Cheers.


Sometimes accurate not real life. You didn't provide the buy / sell conditions or time frames so it isn't possible to provide more of an answer.
You need to fix your price= statement:
If you're testing the strategies in thinkscripts, the most accurate P&L is when the AddOrder entry time is set as "open[-1]". Meaning that it will mark the price of the open of the candle after the signal is fully met.

So the strategy will only ever mark a price as an entry if a candle closes with all the conditions met. Then once that candle has closed, the entry is marked as the open of the next candle. Having followed strategies live, this is the most realistic.

The following are never accurately portrayed in backtesting:
Repainting Indicators
MTF Indicators
Aggregations under 3-5min (dependent on strategy)
 
Solution
Sometimes accurate not real life. You didn't provide the buy / sell conditions or time frames so it isn't possible to provide more of an answer.
You need to fix your price= statement:


The following are never accurately portrayed in backtesting:
Repainting Indicators
MTF Indicators
Aggregations under 3-5min (dependent on strategy)
Thanks for taking the time to reply, that was helpful. I had one more quick question. The signals on my chart show up as BUY 1(50) when signaling a long entry for example. Could you break down what that means? I have my global settings set to 1 contract so I'm confused as to where 50 is coming from? Is it one order of 50 contracts?
 
Thanks for taking the time to reply, that was helpful. I had one more quick question. The signals on my chart show up as BUY 1(50) when signaling a long entry for example. Could you break down what that means? I have my global settings set to 1 contract so I'm confused as to where 50 is coming from? Is it one order of 50 contracts?
AddOrder
Adds an order of specified side and position effect for the next bar when the condition is true.

Input parameters​

ParameterDefault valueDescription
typeOrderType.BUY_AUTODefines order side and position effect using the OrderType constants.
condition-Defines condition upon which the order is added.
priceopen[-1]Defines price at which the order is added.
tradeSize-Defines the number of contracts traded. Note that this value overrides the trade size specified in Strategy Global Settings.
tickColorColor.MAGENTADefines the color of tick marking the trade price.
arrowColorColor.MAGENTADefines the color of signal arrow.
nameColor.MAGENTADefines the order name which will be displayed on "Orders" tabs in strategy settings, in strategy report, and as captions to the Buy/Sell signal arrows on chart. By default, all orders use the same name as the strategy itself.

Example​

AddOrder(OrderType.BUY_AUTO, close > close[1], open[-1], 50, Color.ORANGE, Color.ORANGE, "Sample buy @ " + open[-1]);
If the current Close price is higher than the previous, the code opens the long position or closes the short one at the Open price of the next bar. The trade size will be equal to 50, signals will be colored orange, and each signal will display the buying price.
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
273 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top