Comments (5)
As an example, even if the step size is 50, it goes through each number separately. I noticed that it works fine for small numbers like "0.1" but for integers like "2", "5" or "10" it doesn't work anymore.
from tradingview-optimizer-extension.
Thanks for raising the issue @Avyyys ,
Could you please share the sample publicly available TradingView Strategy with the exact 'start' 'end' parameters that you are running? So that I can reproduce the issue on my side.
Once you share it here, I will share the details regarding the issue.
from tradingview-optimizer-extension.
This is not the same code as in the picture, but with this strategy I have had the same problem. Often, Optipie also calculates quite a lot of extra values for some reason and sometimes it has finished earlier than it should and also made an incomplete report.
In this code, I have had 2 parameters open, the values of the first parameter are 5 - 30 - 2 and the values of the second parameter are 50 - 250 - 10. Once I tried to add two more parameters, both of which had values of 1 - 6 - 1, but then it went completely messed and kept calculating extra values.
//@Version=5
strategy(title="Double MA Strategy", shorttitle="DMA", overlay=true)
// Input for the lengths of two MAs
len1 = input.int(9, minval=1, title="Length1")
len2 = input.int(80, minval=1, title="Length2")
// Function to calculate different types of MAs
ma(source, length, type) =>
switch type
1 => ta.sma(source, length) // SMA
2 => ta.ema(source, length) // EMA
3 => ta.wma(source, length) // WMA
4 => ta.vwma(source, length) // VWMA
5 => ta.rma(source, length) // SMMA
6 => ta.hma(source, length) // HMA
// Input for the types of two MAs
type1 = input.int(title = "Type1", defval = 2, minval = 1, maxval = 6) // Default is EMA
type2 = input.int(title = "Type2", defval = 2, minval = 1, maxval = 6) // Default is EMA
// Calculation of two MAs
ma1 = ma(close, len1, type1)
ma2 = ma(close, len2, type2)
// Plotting two MAs
plot(ma1, title="MA1", color=color.blue)
plot(ma2, title="MA2", color=color.red)
// Conditions for entry and exit signals
buySignal = ta.crossover(ma1, ma2)
sellSignal = ta.crossunder(ma1, ma2)
// Using strategy.entry and strategy.close for signals
if (buySignal)
strategy.entry("Buy", strategy.long)
if (sellSignal)
strategy.entry("Sell", strategy.short)
// Closing positions
strategy.close("Close Long Position", when = sellSignal)
strategy.close("Close Short Position", when = buySignal)
from tradingview-optimizer-extension.
Hey @Avyyys
I have just checked that out and problem is that your OptiPie Step Size
should always match Pinescript Step Size
for the given input 'X'.
I have set 'step size' values explicitly for the first 2 inputs like this:
// Input for the lengths of two MAs
len1 = input.int(9, minval=1, title="Length1", step = 2)
len2 = input.int(80, minval=1, title="Length2", step = 10)
To match the step sizes which you set for OptiPie.
You can find the sample optimization report for this strategy, for BTCUSD
Please let me know if you have further questions.
from tradingview-optimizer-extension.
Apparently that is a quite common issue that has been raised here multiple times so that to mitigate this problem I will add this solution to FAQs
from tradingview-optimizer-extension.
Related Issues (15)
- Fix - strategySymbol query selector due to Tradingview updates HOT 3
- Time period value in the report is empty due to changes made on tradingview.com HOT 1
- Show correct period in reports HOT 9
- Optimization of floating point value is broken HOT 4
- Ability to pick which input fields to optimize (Enhancement Request) HOT 2
- Optimizer going beyond parameter inputs (Bug?) HOT 2
- [Enhancement] - Build / save report HOT 1
- Nothing works right HOT 1
- Ability to stop process and get partial report HOT 1
- Ability to test on Watchlist and timeframe HOT 2
- Still running ignoring stop parameter HOT 3
- Deep Backtesting HOT 7
- MutationObserver not firing HOT 2
- Would be great to optimize negative values for short trades. For example: If the angle of inception is between 0 and -3 degrees. HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tradingview-optimizer-extension.