Giter VIP home page Giter VIP logo

Comments (5)

Avyyys avatar Avyyys commented on June 1, 2024
image

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.

AtakanPehlivanoglu avatar AtakanPehlivanoglu commented on June 1, 2024

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.

Avyyys avatar Avyyys commented on June 1, 2024

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.

AtakanPehlivanoglu avatar AtakanPehlivanoglu commented on June 1, 2024

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

report-1703197950317.csv

Please let me know if you have further questions.

from tradingview-optimizer-extension.

AtakanPehlivanoglu avatar AtakanPehlivanoglu commented on June 1, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.